Forum Discussion

Julie_'s avatar
Julie_
Frequent Visitor
3 years ago
Solved

Filter a Distinctcount function by another measure

Hello,   i need a measure that calculated the distinct count of Items, but only for the months January and December. So it should just distinct count the items where the Measure i already wrote is ...
  • johnt75's avatar
    johnt75
    3 years ago
    Distinct count Jan Dec =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Column] ),
        FILTER ( VALUES ( 'Table'[Column] ), NOT ISBLANK ( [My Measure] ) )
    )
    

    If column is enough to correctly identify the row and produce the value for the measure then this should work. If additional columns are needed in the filter context then you can replace VALUES with a SUMMARIZE statement including all necessary rows.