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!View all the Fabric Data Days sessions on demand. View schedule
Hi,
Say I am working on the datamodel found in this report :
https://tinyurl.com/2upv9t53
I want to create a similar table to this, where distinct count of customerIds are displayed for all rows (in this case it would be the number of customerIds in the category group, and ignore all filters on the customers table. So the expected outcome would be something like this:
I have tried the formula in the screenshot below, but it seems to give me a cartesian product of some sort.
Here is the Customer table showing its mapping with the customergroup table:
Solved! Go to Solution.
@bk-ikram Try the following. PBIX attached below signature.
Measure =
VAR __Group = MAX( 'Customer'[CategoryGroup] )
VAR __Sales = SUM( 'Sales'[Sales] )
VAR __CountCustomers =
COUNTROWS(
DISTINCT(
SELECTCOLUMNS(
FILTER(
ALLSELECTED('Customer'),
[CategoryGroup] = __Group
),
"__Customer", [Customer Name]
)
)
)
VAR __Result = IF( __Sales = BLANK(), BLANK(), __CountCustomers )
RETURN
__Result
@bk-ikram Try the following. PBIX attached below signature.
Measure =
VAR __Group = MAX( 'Customer'[CategoryGroup] )
VAR __Sales = SUM( 'Sales'[Sales] )
VAR __CountCustomers =
COUNTROWS(
DISTINCT(
SELECTCOLUMNS(
FILTER(
ALLSELECTED('Customer'),
[CategoryGroup] = __Group
),
"__Customer", [Customer Name]
)
)
)
VAR __Result = IF( __Sales = BLANK(), BLANK(), __CountCustomers )
RETURN
__Result
Thank you Greg, this solution seems to do the trick. I just thought that there could be a more "straight-forward " solution. I would appreciate it if you could briefly explain why the formula I tried would not work.
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!
| User | Count |
|---|---|
| 18 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 21 | |
| 14 | |
| 12 |