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 sup...
- 2 years ago
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/
ValtteriN
2 years agoCommunity Champion
Hi,
Here is an example:
Data:
Calculated column:
Age Bracket =
var _age = [Age] RETURN
SWITCH(TRUE(),
_age<10,"0-9",
_age<20,"10-20",
_age<30,"20-30")
End result:
This is the base logic, you can add more categories by using different measures. Here I am simply adding male and female counts.
Dax measures:
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/