I have a measure that calculates volume for a particular date by SAP ID - Measure1.
I want to use Measure1 to calculate the total count of SAP ID with volume >0 to create another measure.
I tried using
Measure1=var m1=MAX(date_test[year_month]) var Currentdate=DATE(year(m1),MONTH(m1)-12,DAY(m1)) var Previousdate=DATE(year(Currentdate),MONTH(Currentdate)-12,DAY(Currentdate)) var Result = CALCULATE( SUM('Datas Vol'[Total Volume]),FILTER(Dates,Dates[date]>=Previousdate && Dates[date]<Currentdate)) return Result
Hi @Anonymous ,
Referring to the example above, you can try to create such a measure for your needs:
Measure2 = VAR t = CALCULATE ( DISTINCTCOUNT('Table'[Colunmname]), FILTER ( ALLSELECTED('Table'), [Measure 1] > 2 ) ) RETURN IF ( [Measure 1] > 2, t, 0 )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Apologies since I saw you wanted the count of unique values. I changed the meaures to:
Count = CALCULATE( DISTINCTCOUNT(Table [SAP ID]), FILTER(Table, [Measure1> 0) )
Get a sneak peek into this year's Power Platform Conference Keynote.
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!