Forum Discussion
Distinct count on measure within table context
- Anonymous2 years ago
Okay, I somehow managed to create a working measure.
It looks like this:CALCULATE( COUNTROWS(SUMMARIZE(Calender, Calender[Date])) + 0, FILTER(Calender, [Number of objects available & unavailable with valid reason] - [Minimal number of objects] < 0) )
I completely skipped the part where I create a measure that contains the word 'FLAG' and then performing a (distinct) count on that measure. I think the problem was that in my 'FLAG'-measure, I used:MIN(Calender[DateTime])
.. which is why it only worked when I included the [DateTime].
v-yanjiang-msft (& AllisonKennedy )
I'm revisiting this topic two and a half years later. I haven't been able to figure it out and would appreciate your help on this one. The measure I'm looking for is included in a monthly report and right now, I'm doing the embarrassing monthly task of counting distinct values for 'flag' by hand and writing the correct result (for 10+ groups) into a excel file which I then use in the PowerBI. Does my previous reply give enough information to conclude anything?
Okay, I somehow managed to create a working measure.
It looks like this:
CALCULATE(
COUNTROWS(SUMMARIZE(Calender, Calender[Date])) + 0,
FILTER(Calender, [Number of objects available & unavailable with valid reason] - [Minimal number of objects] < 0)
)
I completely skipped the part where I create a measure that contains the word 'FLAG' and then performing a (distinct) count on that measure. I think the problem was that in my 'FLAG'-measure, I used:
MIN(Calender[DateTime])
.. which is why it only worked when I included the [DateTime].