Forum Discussion
Matrix table with two rows diffrent Aggregation
- Anonymous1 year ago
Hi, sanjaymithran
I'm sorry I misunderstood what you meant, I modified the measure and you can use the DAX below:
%Sale = VAR _Total = DIVIDE( CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Category])), CALCULATE(SUM([Sales]), ALL('Table')), 0 ) VAR _Category = DIVIDE( SUM([Sales]), CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Category])), 0 ) RETURN IF(ISINSCOPE('Table'[Product]),_Category,_Total)The following is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yongkang Hua,
Thanks for your quick response,I already did like that only but user want single field % Sales.
Product level % Sales within Category and Category level % Sales of Total in Single field because we have many % fields so if we use two for each table too height ,is it possible in single field?
Thanks,
Sanjay.
Hi, sanjaymithran
I'm sorry I misunderstood what you meant, I modified the measure and you can use the DAX below:
%Sale =
VAR _Total = DIVIDE(
CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Category])),
CALCULATE(SUM([Sales]), ALL('Table')),
0
)
VAR _Category = DIVIDE(
SUM([Sales]),
CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Category])),
0
)
RETURN
IF(ISINSCOPE('Table'[Product]),_Category,_Total)
The following is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.