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
Hi, first, thank you for reading this post.
We have a set of specific CustomerIDs that we're beginning to track Total Units sold by SalesOrderID.
The wrinkle is that one specific CustomerID has a list of specific SalesOrderID that are to be included, excluding all of their other SOID.
The dataset has been pre-filtered to only include the specific CustomerID that are relevant to this particular report.
What I'm looking for is the proper DAX for a new measure (Total Units) that will calculate total units for all SOID for all CustomerID, but only the specific SOID for the one CustomerID.
Assume we have CustomerIDs:
CUST0000123
CUST0000234
CUST0000345
CUST0000456
Where CUST0000234 is the specific customer that needs to only include the following SalesOrderIDs associated with their account:
SO0000789
SO0000897
SO0000987
The very basic report will include Sales Order Date, CustomerID, Customer Name, SalesOrderID, ItemID, Total Units
Note: A SalesOrderID can only be associated with one CustomerID.
Note 2: All data elements are sourced from one table 'CurrentSales'
Solved! Go to Solution.
Try this measure:
Total Units Sold =
VAR vTable =
FILTER (
CurrentSales,
CurrentSales[CustomerID] <> "CUST0000234"
|| ( CurrentSales[CustomerID] = "CUST0000234"
&& CurrentSales[SalesOrderID] IN { "SO0000789", "SO0000897", "SO0000987" } )
)
VAR vResult =
SUMX ( vTable, CurrentSales[UnitsSold] )
RETURN
vResult
Proud to be a Super User!
Try this measure:
Total Units Sold =
VAR vTable =
FILTER (
CurrentSales,
CurrentSales[CustomerID] <> "CUST0000234"
|| ( CurrentSales[CustomerID] = "CUST0000234"
&& CurrentSales[SalesOrderID] IN { "SO0000789", "SO0000897", "SO0000987" } )
)
VAR vResult =
SUMX ( vTable, CurrentSales[UnitsSold] )
RETURN
vResult
Proud to be a Super User!
Thank you. This worked perfectly. Appreciate the quick assistance. Cheers to you!
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 |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 19 | |
| 17 | |
| 11 |