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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi,
I have table with columns "status","ID"
I need to count the rows that have "Active" status but with distinct ID and then put it into a new measure.
How can i filter my table on "Active" status and then remove the non distinct rows + sum the result?
Thanks!
Solved! Go to Solution.
Please use the DAX below.
Measure 2 = CALCULATE(DISTINCTCOUNT(Table1[ID]),FILTER(Table1,Table1[Status]="Active"))
Regards,
Charlie Liao
Hi,
Try this
=CALCULATE(DISTINCTCOUNT(Data[ID]),Data[Status]="Active")
Hope this helps.
Can you please attach the table that you are using as your dataset along with the expected results?
| ID | Status | ||||
| 1 | Active | ||||
| 1 | Active | ||||
| 1 | Not Active | ||||
| 2 | Active | ||||
| 3 | Not Active | ||||
| 2 | Active |
i want to add new measure with value that based on the table above will be 2, because after i filter the Active and remove distinct i will have only 2 rows.
Hi,
Try this
=CALCULATE(DISTINCTCOUNT(Data[ID]),Data[Status]="Active")
Hope this helps.
Try:
Measure = CALCULATE(COUNTROWS(DISTINCT(Table1[ID])),FILTER(Table1,Table1[Status]="Active"))
I cant DISTINCT first because i might left with ID that have "Not Active" status although there is ID with Active status
Please use the DAX below.
Measure 2 = CALCULATE(DISTINCTCOUNT(Table1[ID]),FILTER(Table1,Table1[Status]="Active"))
Regards,
Charlie Liao
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 70 | |
| 51 | |
| 42 | |
| 29 | |
| 22 |
| User | Count |
|---|---|
| 142 | |
| 119 | |
| 56 | |
| 37 | |
| 32 |