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.
Hi everyone, I have two columns with product categories... Each column have their own measure (in this case produced tons)... I need to summarize the content of both category columns and show the Sum for each category... In Excel it´s easy using "IF" but I don´t find the right way to do this in Power BI...
this is the summary of the previous image, in this case I need to calculate the sum of MT + MT keeping the categories... My expected result its have Clarsil = 92 MT
I appreciatte your support.
Solved! Go to Solution.
I'd approach it like this:
MT Total =
VAR thisProduct = SELECTEDVALUE(<your first product field>) RETURN
VAR excessTons = CALCULATE(SUM(<excess tons field>, ALL(<first product field>), <second product field> = thisProduct)) RETURN
SUM(MT) + excessTons
This formula relies on the filter context of your second matrix table to find the indicated product, and apply that product filter to your second field (while ignoring what's in the first) and add the two sums together.
I am not sure what is the dax for this MT_Exc measure, however you could just add another expression to it.
MT_Exc = (current expression) + calculate(sum([MT]), filter(table,[Product]="CLARSIL"))
If not working please share your formula for the MT_Exc measure.
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
I'd approach it like this:
MT Total =
VAR thisProduct = SELECTEDVALUE(<your first product field>) RETURN
VAR excessTons = CALCULATE(SUM(<excess tons field>, ALL(<first product field>), <second product field> = thisProduct)) RETURN
SUM(MT) + excessTons
This formula relies on the filter context of your second matrix table to find the indicated product, and apply that product filter to your second field (while ignoring what's in the first) and add the two sums together.
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 |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |