Forum Discussion
% Total By Category In A Matrix
Hello!
I'm looking to get a % total by department into a matrix like below:
I've created a product count measure in Power BI, but when I try and created the % measure it calculates it as the total % for the whole table rather than by department.
Any help greatly appreciated.
Thanks!
Hi Anonymous ,
According to your decription, here's my solution.
Create a measure.
Product Count% = VAR _SUM = SUMX ( FILTER ( ALL ( 'Table' ), 'Table'[Department] = MAX ( 'Table'[Department] ) ), 'Table'[Product Count] ) RETURN IF ( ISINSCOPE ( 'Table'[Fabric] ), DIVIDE ( MAX ( 'Table'[Product Count] ), _SUM ), 1 )Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
According to your decription, here's my solution.
Create a measure.
Product Count% = VAR _SUM = SUMX ( FILTER ( ALL ( 'Table' ), 'Table'[Department] = MAX ( 'Table'[Department] ) ), 'Table'[Product Count] ) RETURN IF ( ISINSCOPE ( 'Table'[Fabric] ), DIVIDE ( MAX ( 'Table'[Product Count] ), _SUM ), 1 )Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- PC2790Community Champion
If you are looking to get a customised structure in a matrix, you will have to create a new table with the categorise and subcategories you want to show and then create a measure to associate it with the outcome values.
You can refer this article:
Creating a “custom” or “hybrid” matrix in PowerBI - Microsoft Power BI Community
https://exceleratorbi.com.au/building-a-matrix-with-asymmetrical-columns-and-rows-in-power-bi/
- nasolmeHelper I
Hi,
Mesure = divide(sum('Table (2)'[production count]),CALCULATE(sum('Table (2)'[production count]),all()))