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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I have the below sample dataset. I am trying to create a measure which gives the occurence of the attribute A but I only want A's occurence to be counted once per ID value.
For the sample dataset the measure should return a count of 3 (Once from ID=1, Once from ID=3 and Once from ID=4).
Any help would be much appreciated.
| ID | Attribute |
| 1 | A |
| 1 | A |
| 1 | B |
| 2 | B |
| 2 | B |
| 3 | A |
| 3 | A |
| 3 | C |
| 4 | A |
Thanks,
Ali
Solved! Go to Solution.
Hi,
Write these measures
A count = CALCULATE(COUNTROWS(Data),Data[Attribute]="A")Measure = COUNTROWS(FILTER(VALUES(Data[ID]),[A count]>0))
Hope this helps.
Hi,
Write these measures
A count = CALCULATE(COUNTROWS(Data),Data[Attribute]="A")Measure = COUNTROWS(FILTER(VALUES(Data[ID]),[A count]>0))
Hope this helps.
You are welcome.
hi @aloosh89 ,
Are you trying to count the occurence fo each item in ID just once. If so, try this measure:
Count =
COUNTROWS ( SUMMARIZE ( 'Table', 'Table'[ID], 'Table'[Attribute] ) )
Is this what you are looking for?
Sample PBIX file attached
Counting occurence of attribute only once per ID.pbix
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!