The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all
Let us say I have data like this
District & Village | Total Population | Youth | Youth% |
A1 | 500 | 100 | 20% |
A2 | 600 | 300 | 50% |
A3 | 700 | 175 | 25% |
A4 | 200 | 25 | 12.5% |
B1 | 400 | 44 | 11% |
B2 | 200 | 16 | 8% |
How do I make sure that the percentages are aggregated rightly as in the table below? Many thanks for the help
District(rural) | Total Population | Youth | Youth% |
A | 2000 | 600 | 30% |
B | 600 | 60 | 10% |
Solved! Go to Solution.
Well if your youth% is a measure, it will do that correct automatically!
Your formula for youth% should be something like:
Youth%=SUM(Youth)/SUM(Total Population)
If you now display it as Districts only (you can split the column District & village for example), the calculation will still work, but with a different Evaluation context. It will now sum all the total populations in district A together, and all the youth, and generate the correct percentage.
Hope that helps!
Jaap
HI @DataTyp,
If 'Youth %' is a measure, you can add a calculate column to store new category and use new category to summary visual.
Measure Youth % formula:
Youth % = SUM(Test[Youth])/SUM(Test[Total Population])
Steps:
1. Add calculated column district(rural).
District(rural) = LEFT([District & Village],1)
2. Create new table visual with above column, change 'Total Population' and 'Youth' columns' summary mode to 'SUM'.
Regards,
Xiaoxin Sheng
HI @DataTyp,
If 'Youth %' is a measure, you can add a calculate column to store new category and use new category to summary visual.
Measure Youth % formula:
Youth % = SUM(Test[Youth])/SUM(Test[Total Population])
Steps:
1. Add calculated column district(rural).
District(rural) = LEFT([District & Village],1)
2. Create new table visual with above column, change 'Total Population' and 'Youth' columns' summary mode to 'SUM'.
Regards,
Xiaoxin Sheng
Well if your youth% is a measure, it will do that correct automatically!
Your formula for youth% should be something like:
Youth%=SUM(Youth)/SUM(Total Population)
If you now display it as Districts only (you can split the column District & village for example), the calculation will still work, but with a different Evaluation context. It will now sum all the total populations in district A together, and all the youth, and generate the correct percentage.
Hope that helps!
Jaap