Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
In order to Sum the sales amount of blue products OR products that belong to category shoes, I'm using the following DAX expression:
CALCULATE( SUM(Table[SalesAmount]), FILTER( Table, Table[Color] = "Blue" || Table[Category] = "Shoes") )
However, this doesn't work with two different tables (Colors and Categories), like:
CALCULATE( SUM(Table[SalesAmount]), FILTER( Table, Colors[Color] = "Blue" || Categories[Category] = "Shoes") )
Can anyone help?
Thanks!
Solved! Go to Solution.
Hi @webportal
I got this working in a calculated measure. You may just need to add the RELATED function to the OR condition
CALCULATE( SUM('Table'[SalesAmount]), FILTER( 'Table', RELATED(Colors[Color]) = "Blue" || RELATED(Categories[Category]) = "Shoes") )
Hi @webportal
I got this working in a calculated measure. You may just need to add the RELATED function to the OR condition
CALCULATE( SUM('Table'[SalesAmount]), FILTER( 'Table', RELATED(Colors[Color]) = "Blue" || RELATED(Categories[Category]) = "Shoes") )
Yeah, having relationships is effectly giving you a logical table that includes all the columns from the table on the 1 side of the relationship on the table from the many side.
Good to hear it works!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |