Visual Studio Report Designer: I don't understand group filters - visual-studio

I'm writing a report that has proposal information by estimator per month. So I created a matrix where each row is grouped by estimator and each column is grouped by the month.
The thing is, my query includes data for this year AND last year, but the columns by month should only contain this year's information. So I though simple, I'll create a filter: Year(variable_date) = Year(Today()).
When I do this, no record information shows up. But then I changed the column to group by month AND year and suddenly, it works. Only 2015 records show up in the calculations per month.
Why did I need to group it by month AND year? Why couldn't I just group by month and have the filter remove records that didn't have the correct year using the filter group property tab?
Thanks!
P.S. I hope I have the tags right...

It sounds like month and year are separate fields. So when you group only by month it is grouping all of the rows where the value for that field is the same. (Month=8 exists in 2014 and 2015.) The values are just numbers to SSRS and it doesn't know it needs to look at the year field too unless you tell it to.

Related

How can I filter a table for the field values on the last(highest) date in a custom four week period, using DAX in Power BI?

I created a calculated table based on start and end dates to check which manager is responsible for a product per date.
Result:
The financial department uses a four week period to report. So 13 periods per year.
(not usable in a date table?)
Product number 8098 gets a different manager on the 23rd of januari this year.
So at the start manager C5104 is responsible and at the end of period one (202301) C5107 is responsible.
To get one responsible manager per period I'd like to filter the table in such a fashion that I get the numbers from the last date in a period. After filtering I don't need the [date] field anymore.
I hope I'm just missing something basic like the 'ELLEXCEPT' But I'm lost...
DISTINCT gives:
One row too many. I'd like to lose the row: 8098, C5104, 202301.
To keep only rows showing the manager per product at the end of a period.

*SOLVED* How do I sort columns in a Matrix view?

I am attempting to create a gantt chart in Power Bi using the matrix view, and the end user wants it to have year, quarter, and month. The year and quarter columns are fine, but the month columns are out of order, and I cannot seem to figure out how to put them in order. My calendar table and everything in it are created using dax.
So far, I haven't really tried anything. I am assuming Power Bi is not recognizing them as months in a date table and that is why it is not sorting them accordingly, but alphabetically by quarter and year.
You need a sort by column.
You can read how to create one here.
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column?tabs=powerbi-desktop

DAX - Month Name column error when dropped in value field

I have a simple date table (marked as a Date Table)
the Date column is native to it, the rest are calculated columns.
This issue will be about these of them:
Month Name = FORMAT(Dates[Date], "Mmmm")
Month = Month(Dates[Date])
Both set to "Don't summarize".
I dropped them into value field of a visual out of curiousity, and a curious thing happened - despite "don't summarize" they took MIN form of value to display, but Month Name came out incorrect.
Image 1: 3 out of 4 lines in the column First Month Name are wrong, unlike Month which is fine.
Image 2: added Date to the row fields to check - line by line it's fine, but subtotal still wrong:
Image 3: I filtered Month Name in data view for February, to see which lines are for Month value of 1 - there is none.
This is a blank new report, no measures, no filters - that's all it is.
If someone can explain why this happens, thanks in advance
The columns with "Earliest"/"First"/"Min" are summarizing because they are implicit measures in a matrix visual. Since there are multiple months in one quarter it has to aggregate somehow.
The month name is a text field, so it sorts alphabetically by default. If you want it to sort by month number instead, you can use the Sort by Column feature to sort Month Name by Month.

Building a matrix with columns == days of month when recordset cannot return all days of month

I'm trying to put together an attendance report for a school that tracks student attendance codes for that student for every day on the calendar month in a DynamicsCRM system being used as a managed service (that is to say, I build queries using FetchXML and cannot use SQL). The format for the report requires that a column for every day in the month be listed for the report. My student table that tracks this attendance however only contains records for days where an attendance value is recorded, and I do not have an object available that can return every day in a month for me.
I am looking for a solution other than hardcoding 31 columns and using conditionals to control the display of the last three day columns. Ideally, I'd like a conditional in my matrix column grouping that would look at the date value for the previously generated column and determine if the next date record from my resultset is sequentially the next day of that month, and if not, create the next sequential date, move to the next column and perform the check again until it is true. Is there a way I can do this, or another means to accomplish my goal that does not involve hard-coding day columns into a table or matrix? Right now, I have nothing; I can barely imagine how I think this should look.
What I did to solve the same issue has been to create a scheduled process each day to create a record and deactivate it.
I have then been able to distinguish actual records (the active ones) from these 'placeholders' (inactive ones) in my querying.

Can I generate the number of business days in a month in Visual Studio?

I have a report that takes sales data from a few tables. I want to add a field that will divide the total sales for the given month by the total number of business days in that same month. Is there a way I can calculate that in an expression? Do I need to create a new table in the database specifically for months and their number of business days? How should I go about this?
Thank you
Intuitively, I would say that you need a simple function and a table.
The table is to host the exceptions like Independence day, labor day, etc.
The function will get two parameters: Month and Year (I'm not providing any sample code since you haven't specified which language you are using).
It will then build a date as yyyy-mm-01 (meaning, first day of the month). If will then loop from 2 to 31 and:
Create a new date by adding the index of the loop to the initial date,
Check if the resulting date is still within the month,
Check if it is a working or not working day (e.g. Sunday),
Check if it is found within the table of exceptions.
If the created date passes all the above tests, you add 1 to the counter.
Though it might look complex, it is not and it will provide you the correct answer regardless of the month (e.g. Feb.) and the year (leap or not).

Resources