Forum Discussion
Anonymous
4 years agoNot applicable
Create a proportion table
Hi, I have a data table like this : And I want to create a proportion table like this : With the total production of each country (every year) and the percentage of drying dire...
v-xiaotang
4 years agoCommunity Support
Hi Anonymous
Thanks for reaching out to us.
How about using this?
Per % =
VAR _DryingDirectPerYear =
CALCULATE (
SUM ( 'Table'[Valeur] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Year] ),
'Table'[Category] = "Drying Direct"
)
)
VAR _TotalPerYear =
CALCULATE ( SUM ( 'Table'[Valeur] ), ALLEXCEPT ( 'Table', 'Table'[Year] ) )
RETURN
IF (
ISFILTERED ( 'Table'[Country] ),
BLANK (),
_DryingDirectPerYear / _TotalPerYear
)
Since the Total column is the sum of the each value of the matrix, you need to put the measure in the value of the matrix if you want Percentage to appear in it, which will cause the measure to appear in each column of the matrix.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.