Forum Discussion
Count over Measure with Conditions
- 8 years ago
Hi Anonymous,
Based on the PBIX file you shared I believe that the issue is based on context because in the measure you created you are making based on Name and Date but on the count of the percentages you are not giving that same context so the result is not correct.
Create a column based on the date from your table:
MONTH = FORMAT(TABLE[DATE];"mm-yyyy")
Then create the following measure:
COUNT % 20 - 25 = COUNTROWS ( FILTER ( SUMMARIZE ( ALL ( TABLE[NAME]; TABLE[MONTH] ); TABLE[NAME]; TABLE[MONTH]; "% Count"; [MEASURE TO BE COUNTED] ); [MEASURE TO BE COUNTED] >= 0,2 && [MEASURE TO BE COUNTED] <= 0,25 ) )Believe this should work, but check the PBIX file I have return to you trough private message.
Regards,
MFelix
Hi Anonymous,
Based on the PBIX file you shared I believe that the issue is based on context because in the measure you created you are making based on Name and Date but on the count of the percentages you are not giving that same context so the result is not correct.
Create a column based on the date from your table:
MONTH = FORMAT(TABLE[DATE];"mm-yyyy")
Then create the following measure:
COUNT % 20 - 25 =
COUNTROWS (
FILTER (
SUMMARIZE (
ALL ( TABLE[NAME]; TABLE[MONTH] );
TABLE[NAME];
TABLE[MONTH];
"% Count"; [MEASURE TO BE COUNTED]
);
[MEASURE TO BE COUNTED] >= 0,2
&& [MEASURE TO BE COUNTED] <= 0,25
)
)
Believe this should work, but check the PBIX file I have return to you trough private message.
Regards,
MFelix
MFelixv-yuta-msftZubair_Muhammad
Thanks everyone for the contribution, the issue is now solved, MFelix solved it perfectly!
Cheers!