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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I need assistance in creating a DAX measure that combines volume data by product code (stored in Dataset 1) with the Average Selling Price (ASP) (stored in Dataset 2). The product codes in Dataset 2 are linked to Dataset 1 via a separate table (Dataset 3), which contains the equivalent product codes and has a direct relationship with Dataset 2.
The goal is to generate a report that displays sales based on volume from Dataset 1 and ASP from Dataset 2. The DAX measure should calculate sales per product code, and it should also be capable of aggregating these individual sales figures to provide a total sales amount across all product codes.
Thank you in advance for your help!
Thank you! Unfortunately, I should have clarified that each product code has multiple rows, so the LOOKUPVALUE function doesn't work in this context. I tried the DAX below, but it's not summing the total correctly and it's not very efficient in terms of performance.
Hi @apohl1,
Please try the DAX measure below. I received the following output.
Total Sales =
SUMX (
VALUES ( 'Volume Data'[ProductCode] ),
VAR Volume =
CALCULATE ( SUM ( 'Volume Data'[Volume] ) )
VAR ASP =
CALCULATE (
AVERAGE ( 'ASP Data'[ASP] ),
TREATAS ( VALUES ( 'Volume Data'[ProductCode] ), 'Mapping Table'[ProductCode] )
)
RETURN
Volume * ASP
)
Thank you.
Hi @apohl1,
I’ve recreated the issue using sample data and configured the model with Volume, ASP, and a Mapping table. After setting up the relationships and creating the DAX measure, I obtained the expected output. I’ve attached the PBIX file for your reference.
Total Sales =
SUMX (
'Volume Data',
'Volume Data'[Volume] *
LOOKUPVALUE (
'ASP Data'[ASP],
'ASP Data'[ProductCode2],
RELATED ( 'Mapping Table'[ProductCode2] )
)
)
Thank you.