Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have a table which has the a birth_date column. I have added 2 new measures in the table to calculate today's age, and divide the age into age groups:
Age measure:
Age = DATEDIFF(SELECTEDVALUE(birthDates[birth_date]), TODAY(), DAY) / 365.25
Age group measure:
AgeGroup =
var age = [Age]
RETURN
SWITCH(TRUE(),
age < 16, "0-15",
age < 25, "16-24",
age < 34, "25-33",
age < 43, "34-42",
age < 52, "43-51",
age < 61, "52-60",
age < 79, "60-78",
"79+"
)
I want to create a column chart having age group on the x axis, and count of birth_date on the y axis. But I am not able to add the AgeGroup on the x-axis.
How do I do this?
I have attached the Power BI report link below:
Solved! Go to Solution.
Hello @Anonymous ,
FYI we can not add measures directly in to the axis of any visual either you have to create a calculated column or you have to create new What-if Parameter using fields option.
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
Hi @Anonymous ,
You cant plot any measure values on x axis , it should be a coulmn only.
On Y axis you can plot any measure.
For your requirement of plotting this measure in column chart ,
you can do like this ,
Plot date , age, agegroup in tble.
or do like this
in column chart , plot date column in x axis , measure of age in y axis and agegroup in tooltips.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for the response. Is there any way I can show how many rows are in each age group, in a column chart?
Genrally countrow dax is used to find no of rows. But it don't take measure in its paramter.
Check this out
https://learn.microsoft.com/en-us/dax/countrows-function-dax
Hi @Anonymous ,
You cant plot any measure values on x axis , it should be a coulmn only.
On Y axis you can plot any measure.
For your requirement of plotting this measure in column chart ,
you can do like this ,
Plot date , age, agegroup in tble.
or do like this
in column chart , plot date column in x axis , measure of age in y axis and agegroup in tooltips.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous ,
FYI we can not add measures directly in to the axis of any visual either you have to create a calculated column or you have to create new What-if Parameter using fields option.
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!