Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi,
I'm trying to do a DISTINCTCOUNT on the ID column below, but it should count only if there are DRAFT and FINAL status values for the same ID, if there is only one status (be it draft or final) the id should not be counted.
So it should count MER2021073, LOG2021051 and CGM2021032 only.
Someone could help?
Solved! Go to Solution.
@filipeoliveira , use this measure with id
Countx(filter(summarize(Table, Table[ID], "_1", calculate(Distinctcount(Table[Status]), filter(Table, Table[Status] in {"DRAFT","FINAL"}) )),[_1]=2),[ID])
Hi, @filipeoliveira
According to your description, I can clearly understand your requirement, you want to count the amount of the ID if the status is less than 2, right? I think you can create a single measure to use a virtual table like this to achieve your requirement:
Count =
var _table=SUMMARIZE(DISTINCT('Table'),[ID],"Count",DISTINCTCOUNT('Table'[STATUS]))
return
COUNTX(FILTER(_table,[Count]<2),[ID])
And you can create a card chart to get what you want, like this:
You can download my test pbix file below
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
please check the below picture and the attached pbix file.
@filipeoliveira , use this measure with id
Countx(filter(summarize(Table, Table[ID], "_1", calculate(Distinctcount(Table[Status]), filter(Table, Table[Status] in {"DRAFT","FINAL"}) )),[_1]=2),[ID])
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |