Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi Team,
The requirement is to get the count of materials for Max date.
The below logic is getting the distinct count where i want to display the count.
Solved! Go to Solution.
Hi, @SushmaReddy ,
You could create a measure or column as follow:
1.measure:
count = var _max=CALCULATE(MAX('T1'[Date]),ALLSELECTED(T1))
return CALCULATE(COUNT(T1[Material]),FILTER(ALLSELECTED(T1),[Material]=MAX('T1'[Material])&&[Date]=_max&&[Status]="Failed"))
2. column:
Column =
var _max=MAX('T1'[Date])
return CALCULATE(COUNT(T1[Material]),FILTER(ALLSELECTED(T1),[Material]=EARLIER('T1'[Material])&&[Date]=_max&&[Status]="Failed"))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The code is working and getting the correct count ....Thank you for the help
Hi, @SushmaReddy ,
You could create a measure or column as follow:
1.measure:
count = var _max=CALCULATE(MAX('T1'[Date]),ALLSELECTED(T1))
return CALCULATE(COUNT(T1[Material]),FILTER(ALLSELECTED(T1),[Material]=MAX('T1'[Material])&&[Date]=_max&&[Status]="Failed"))
2. column:
Column =
var _max=MAX('T1'[Date])
return CALCULATE(COUNT(T1[Material]),FILTER(ALLSELECTED(T1),[Material]=EARLIER('T1'[Material])&&[Date]=_max&&[Status]="Failed"))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.