Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Not able to add a measure in the visualization

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.

sandeshp_0-1714627996347.png

 

How do I do this?

I have attached the Power BI report link below:

Age Group Power BI report.

2 ACCEPTED SOLUTIONS
Kishore_KVN
Super User
Super User

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!!

View solution in original post

manvishah17
Solution Supplier
Solution Supplier

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 
Screenshot 2024-05-02 112204.png

 

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.

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@manvishah17 , @Kishore_KVN 

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 

manvishah17
Solution Supplier
Solution Supplier

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 
Screenshot 2024-05-02 112204.png

 

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.

 
Kishore_KVN
Super User
Super User

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!!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors