Forum Discussion
dofrancis3
Resolver I
1 year agoCalculate percentage
Dear Team;
I would like to request your support.
How can i calculate the percentage? (Dax). In case I have the tables (1srt one OR second one) below :
Thank you
dofrancis3 , Update measure as
Percentage of Total1 =VAR TotalSum = [Total1] -- Assuming [Total1] is your measureVAR GrandTotal = CALCULATE([Total1], ALL('Table'))RETURNDIVIDE(TotalSum, GrandTotal) * 100Attached updated PBIX considering Total as measure
6 Replies
- Kedar_Pande
Super User
Assuming you want to calculate the percentage of cases based on Gender in the first table:
Create measures:
Total Cases = SUM('YourTableName'[Case])Total Cases Female =
CALCULATE (
[Total Cases],
'YourTableName'[Gender] = "F"
)Total Cases Male =
CALCULATE (
[Total Cases],
'YourTableName'[Gender] = "M"
)Percentage Female =
DIVIDE (
[Total Cases Female],
[Total Cases],
0
)Percentage Male =
DIVIDE (
[Total Cases Male],
[Total Cases],
0
)💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn- dofrancis3
Resolver I
Dear Kedar_Pande Thank you for your replay but i would like to calculate only the percentage of total cases
- bhanu_gautam
Super User
dofrancis3 , Try creating a measure like
Percentage of Total =DIVIDE(SUM('Table'[Total]),CALCULATE(SUM('Table'[Total]), ALL('Table'))) * 100PBIX file attached with solution
- powerbidev123
Solution Sage