Forum Discussion
Calculating percentage
- 4 years ago
RingoSun
It's all about modifying the filter context using CALCULATE.
Example: To get the % of grand total by brand would be as follows. Adjust this example as per your data modelCalc % of Grand Total = DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALLSELECTED ( 'Product'[Brand] ) ) )
RingoSun
It's all about modifying the filter context using CALCULATE.
Example: To get the % of grand total by brand would be as follows. Adjust this example as per your data model
Calc % of Grand Total =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], ALLSELECTED ( 'Product'[Brand] ) )
)
That seems to have done the trick, thanks! But just an additional question.
If I put the newly created percentage measure as my Y- axis in a line chart and Month name as my X - axis, I get this line graph below.
Now I know for a fact that the percentage for client is 15.26% so what I want is instead of the line graph amounting to 100% when you total all the months, I want it to amount to 15.26% instead.
How do I achieve that?