简体   繁体   中英

Power BI (DAX): Distinct Count Filtered by Condition

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

示例数据集

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, eg:

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM