Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Distinct count on measure within table context

Hi all,   Frustration is at an all-time high today..   I have a very complex model in my PowerBI. Lots of tables and measures.   In the end, I have created this table using a complex measure: ...
  • Anonymous's avatar
    Anonymous
    2 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].