Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
Below screenshot is from a measure table, "TotalScore", "ScoreRange" are measures. I want to count one of the measures based on the measure. For example, if I count totalscore, I want to return ((99.6%, 2), (99.0%,2), (97.9%,1)...) How can I do that?
I
Solved! Go to Solution.
Hi @yishenhui
let's assume that this is a student data (this is irrelevant anyway but only to explain)
first create the following calculated table
Marks =
SELECTCOLUMNS ( GENERATESERIES ( 0.001, 0.001, 1 ), "Mark", [Value] )
then use the following measure
Count =
COUNTROWS (
FILTER (
ADDCOLUMNS (
CROSSJOIN ( VALUES ( 'Table'[Student ID] ), VALUES ( Marks[Mark] ) ),
"@Score", [TotalScore]
),
[Mark] = [@Score]
)
)
Hi @yishenhui
let's assume that this is a student data (this is irrelevant anyway but only to explain)
first create the following calculated table
Marks =
SELECTCOLUMNS ( GENERATESERIES ( 0.001, 0.001, 1 ), "Mark", [Value] )
then use the following measure
Count =
COUNTROWS (
FILTER (
ADDCOLUMNS (
CROSSJOIN ( VALUES ( 'Table'[Student ID] ), VALUES ( Marks[Mark] ) ),
"@Score", [TotalScore]
),
[Mark] = [@Score]
)
)
Hi Tamerj,
I understand your DAX but not sure why it's still not working. (I adjusted the Marks table a little
)
Plaxe the column Mark in a new table visual along with the Count measure
Hi Tamerj,
I got more progress. The totalscore is a calculated value which usually is not exact match the mark.value. I used another column scorerange which is result of floor. I got some count numbers and found they are not match the manual count result. I found I need to add column "year/month" to the table as well. Finally I got the correct numbers. I will mark your answer as solution as the method you provided is the key to reslove it. Thanks!