Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
The above image shows a matrix with 'Month' in Rows, 'Year' in Columns and 'Policy Count' in Values.
I need to write DAX Expressions for 'Policy Count TY' and 'Policy Count PY' such that I get same output when I create a matrix with just 'Month' in Rows and the two Expressions, and no filter applied on Year Slicer. Expressions should be able to take Max(Year) and Max(Year)-1.
Further, if I select, say, Nov in Month Slicer, the Matrix is required to show all months upto Nov and not just Nov. Values against each month are required as 'for the month' and not cumulative.
I have tried various options but no luck. I am either getting 'Contiguous Dates' error or getting cumulative output
Thanks
Solved! Go to Solution.
You can see a workaround by using two extra auxiliary tables. See more details in the attached pbix file.
By the way, may I know any reason not using a Matrix?
You can see a workaround by using two extra auxiliary tables. See more details in the attached pbix file.
By the way, may I know any reason not using a Matrix?
Your life (or at least data model) will improve if you add a calendar table.
http://tinylizard.com/power-bi-date-table/
This will allow :
Policy Count PY := CALCULATE([Policy Count], SAMEPERIODLASTYEAR(Dates[Date]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
82 | |
74 | |
66 |
User | Count |
---|---|
121 | |
105 | |
102 | |
82 | |
72 |