Forum Discussion
dofrancis3
2 years agoResolver I
Create age pyramid
Dear Colleagues
Please i would like to request you support to fund a solution regardig the question below:
How can I create an age pyramid like this in Power bi
Thank you for your support.
fd.
Hi,
Here is an example:
Data:Calculated column:
Age Bracket =var _age = [Age] RETURNSWITCH(TRUE(),_age<10,"0-9",_age<20,"10-20",_age<30,"20-30")
Dax measures:
End result:Female count =SUMX('Table (38)',IF([Gender]="M",BLANK(),-1))
Male count =
SUMX('Table (38)',IF([Gender]="F",BLANK(),1))
This is the base logic, you can add more categories by using different measures. Here I am simply adding male and female counts.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
1 Reply
- ValtteriNCommunity Champion
Hi,
Here is an example:
Data:Calculated column:
Age Bracket =var _age = [Age] RETURNSWITCH(TRUE(),_age<10,"0-9",_age<20,"10-20",_age<30,"20-30")
Dax measures:
End result:Female count =SUMX('Table (38)',IF([Gender]="M",BLANK(),-1))
Male count =
SUMX('Table (38)',IF([Gender]="F",BLANK(),1))
This is the base logic, you can add more categories by using different measures. Here I am simply adding male and female counts.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/