Forum Discussion
Incorrect Total in Column Matrix view
- Anonymous6 years ago
Hi Anonymous
I build two tables like yours to have a test.
Table1:
Table2:
Add two measures Volume and Unit Margin into Table1.
Unit Margin = SUM(Table2[Unit Margin])Volume = SUM(Table2[Volume])Then I build a measure and a calculated column to achieve your goal.
Calculated Column:
Actual Difference = VAR _FORMULA = ('Table1'[Unit Margin]-'Table1'[Loc Unit Margin])*'Table1'[Volume] RETURN _FORMULAMeasure:
Difference in Power Bi = VAR _Formula = ( [Unit Margin] - SUM ( Table1[Loc Unit Margin] ) ) * [Volume] RETURN IF ( HASONEVALUE ( Table1[Location] ), _Formula, SUMX ( SUMMARIZE ( Table1, Table1[Location], "_Formula", ( [Unit Margin] - SUM ( Table1[Loc Unit Margin] ) ) * [Volume] ), [_Formula] ) )Result:
You can download the pbix file from this link: Incorrect Total in Column Matrix view
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou
- Anonymous5 years agoNot applicable
Thanks Anonymous, The excel numbers were just a sample to explain the problem I am having. I have all the numbers i have mentioned in the file as Measures in my existing table. Eg: Volume, Unit Margin, Loc Unit Margin. Only customer & Location is a column in my table.
I will try to get a pbix file and share it at the earliest. Thank you for the help!