Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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:
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 @sandeshp ,
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 @sandeshp ,
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!!
User | Count |
---|---|
86 | |
82 | |
68 | |
67 | |
55 |
User | Count |
---|---|
123 | |
100 | |
90 | |
83 | |
66 |