Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have these two tables in my model:
Product_id Sales
A $100
B $400
C $300
A $500
Product_id Category
A Telco
B Telco
C Mobile
I need to do a measure that adds all the sales that are Telco. Can I do this? What would be the DAX?
Solved! Go to Solution.
Hi @maximennella ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can achieve it by the following 2 methods:
1. Create a relationship between these two tables base on Product_id, then create a measure just as suggested by @ryan_mayu
Measure =
VAR _products =
CALCULATETABLE (
VALUES ( 'Category'[Product_id] ),
FILTER ( 'Category', 'Category'[Category] = "Telco" )
)
RETURN
CALCULATE (
SUM ( 'Sales'[Sales] ),
FILTER ( 'Sales', 'Sales'[Product_id] IN _products )
)
2. Create a slicer using Category field after the relationship be created between these two tables just as shown in below screenshot. You don't need to create any measure here, and you can switch the category dynamically to view the sum of sales base on selected category option.
Best Regards
Hi @maximennella ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can achieve it by the following 2 methods:
1. Create a relationship between these two tables base on Product_id, then create a measure just as suggested by @ryan_mayu
Measure =
VAR _products =
CALCULATETABLE (
VALUES ( 'Category'[Product_id] ),
FILTER ( 'Category', 'Category'[Category] = "Telco" )
)
RETURN
CALCULATE (
SUM ( 'Sales'[Sales] ),
FILTER ( 'Sales', 'Sales'[Product_id] IN _products )
)
2. Create a slicer using Category field after the relationship be created between these two tables just as shown in below screenshot. You don't need to create any measure here, and you can switch the category dynamically to view the sum of sales base on selected category option.
Best Regards
create relationship between two tables and create a measure
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 80 | |
| 49 | |
| 35 | |
| 31 | |
| 30 |