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! Don't miss your chance! Learn more
Dear all,
I need to calculate the total number of customers for "Estimated Sales = SALES+FIRM ORDERS+FORECAST". I applied a formulas DAX to calculate the sum of customers of the 3 categories below, however, the output is not the distinct number of customers for the total Estimated Sales. There are duplicates. May you please help? Thanks.
| SALES | FIRM ORDERS | FORECAST | ||
| Customer Code | Customer Code | Customer Code | ||
| A | A | B | ||
| B | B | C | ||
| C | E | F | ||
| D | F | G | ||
| E | G | H | ||
| A | B | C | ||
| C | F | H |
Solved! Go to Solution.
Hey @EZV12 ,
you have to combine the columns first and then count the distinct values.
Try the following measure:
Amount Distinct Customers =
COUNTROWS (
DISTINCT (
UNION (
VALUES ( 'FIRM ORDERS'[Customer Code] ),
VALUES ( FORECAST[Customer Code] ),
VALUES ( SALES[Customer Code] )
)
)
)
Hey @EZV12 ,
you have to combine the columns first and then count the distinct values.
Try the following measure:
Amount Distinct Customers =
COUNTROWS (
DISTINCT (
UNION (
VALUES ( 'FIRM ORDERS'[Customer Code] ),
VALUES ( FORECAST[Customer Code] ),
VALUES ( SALES[Customer Code] )
)
)
)
Hello Denis,
It works!! Thank you very much for your help!
Best regards
Rachel
@EZV12
Try:
Disctinct values =
VAR _Sales =
VALUES ( 'Table'[SALES] )
VAR _FirmOrders =
VALUES ( 'Table'[FIRM ORDERS] )
VAR _Forecast =
VALUES ( 'Table'[FORECAST] )
RETURN
COUNTROWS ( DISTINCT ( UNION ( _Sales, UNION ( _FirmOrders, _Forecast ) ) ) )
Proud to be a Super User!
Paul on Linkedin.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 68 | |
| 59 | |
| 47 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 106 | |
| 102 | |
| 38 | |
| 27 | |
| 27 |