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.
Dear all,
I desperately need help.
I have two tables in my model in power BI, Table A and Table B.
Table B has unique values.The two tables already have a “one-to-many” relationship in the model.
How do you count the unique quantity of a type A that contains B?
Thank you so much
Solved! Go to Solution.
Hi @Yumikang , You can try below measure:
Unique Count = CALCULATE(DISTINCTCOUNT(SheetA[Key Field]),SheetB[Key Field]<>BLANK())
Download PBIX file with the example shown below
The tables are linked together by a relationship on a column, let's call it RelCol.
In a Table visual add RelCol from Table B, then add the column from Table A that you want the unique count of and choose the aggregation Count (Distinct).
In my example I want the distinct count of Column1
Regards
Phil
Proud to be a Super User!
Hi @Yumikang , You can try below measure:
Unique Count = CALCULATE(DISTINCTCOUNT(SheetA[Key Field]),SheetB[Key Field]<>BLANK())
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |