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.
Hello,
I want to create a measure to count non-empty values of MyColumn for the latest date of each month. "Update date" is linked to a Date table.
In my example here, I want to count the values of 27/02 for February and 30/03 for March, so the expected result is:
February 2
March 4
So far I could only get the count of the last date of the table (30/03) with this formula, but not last date of each month:
My measure = CALCULATE( COUNT([MyColumn]); FILTER('My table'; <my filters>); LASTDATE('[Update date]); USERELATIONSHIP('My table'[Update date]; 'Date'[Date]) )
Solved! Go to Solution.
Hi @Anonymous,
Please try this measure:
My measure = CALCULATE ( COUNT ( 'My table'[MyColumn] ), FILTER ( ALL ( 'My table' ), 'My table'[Update date] = CALCULATE ( MAX ( 'My table'[Update date] ), FILTER ( ALL ( 'My table' ), MONTH ( 'My table'[Update date] ) = MONTH ( MAX ( 'My table'[Update date] ) ) && 'My table'[MyColumn] <> BLANK () ) ) ) )
Add [Date] column from Date table to visual.
Best regards,
Yuliana Gu
Hi @Anonymous,
Please try this measure:
My measure = CALCULATE ( COUNT ( 'My table'[MyColumn] ), FILTER ( ALL ( 'My table' ), 'My table'[Update date] = CALCULATE ( MAX ( 'My table'[Update date] ), FILTER ( ALL ( 'My table' ), MONTH ( 'My table'[Update date] ) = MONTH ( MAX ( 'My table'[Update date] ) ) && 'My table'[MyColumn] <> BLANK () ) ) ) )
Add [Date] column from Date table to visual.
Best regards,
Yuliana Gu
Great, thanks! I couldn't have done it by myself...
I don't even see February 2nd and March 4 in your data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
I edited my question, I hope it's clearer now. It's not Feb. 2nd and March 4th but 2 non-empty rows for Feb. and 4 non-empty rows for March.
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 |
---|---|
105 | |
97 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |