Power BI (DAX): Distinct Count Filtered by Condition

50,378
DistinctCountActiveMonths =
CALCULATE(
    DISTINCTCOUNT( 'Net Revenue Data'[Publisher Name] )
    ,'Net Revenue Data'[Active Month] = 1
)
Share:
50,378
AME
Author by

AME

Updated on July 11, 2022

Comments

  • AME
    AME almost 2 years

    I have a data set with publishers with revenue by month. Publishers are considered to be "active" month if their revenue is equal or greater than 1000 for a given month.

    Now, I want to count the distinct number of "active" publishers over a monthly trend using Power BI (DAX).

    Example Data Set

    Example Data Set

    Here is a measure formula that I attempted:

    DistCountActiveMonths = CALCULATE(DISTINCTCOUNT('Net Revenue Data'[Publisher Name]),FILTER('Net Revenue Data','Net Revenue Data'[Active Month]=1))
    

    Please advise how to correct this formula to achieve the desired result, e.g.:

    enter image description here

  • AME
    AME over 8 years
    thanks, I have a follow on question to this. Would you mind taking a look? Power BI (DAX): Calculating MoM Variance of a Measure Field stackoverflow.com/q/35441610/153639