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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Dynamic Value

Hello All,

My requirement is to identify a group of age from an age column using a filter. While the filter value is 10 means, I want the x-axis value as the sum of 10 like 0-10,10-20......etc.depends upon data.

 

Actually, I did this one with static data by using the age group method in the table.dd.pngdd2.pngScreenshot 2021-08-17 160156.png

 

But I want to generate age difference(0-10,10-20......) dynamically based on slicer value, without static data how can I achieve this one.

Please help with this one. Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Use column [Attribute] as slicer.

vyangliumsft_0-1629355903277.png

2. Create measure.

measure_value =
var _select =SELECTEDVALUE('Table'[Attribute])
var _age1=SUMX(FILTER('Table','Table'[Attribute]=_select),[Age]
var _age2=_age1+_select
var _age3=_age1-_select
return
SWITCH(
    TRUE(),
_select in {2,5,6},_age1 &"-"& _age2,
_select in {3,4} ,_age3 &"-"& _age1)

3. Result:

When Attribute=2 is selected, it is displayed as:

vyangliumsft_1-1629355903279.png

When Attribute= 3 is selected, it is displayed as:

vyangliumsft_2-1629355903281.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Use column [Attribute] as slicer.

vyangliumsft_0-1629355903277.png

2. Create measure.

measure_value =
var _select =SELECTEDVALUE('Table'[Attribute])
var _age1=SUMX(FILTER('Table','Table'[Attribute]=_select),[Age]
var _age2=_age1+_select
var _age3=_age1-_select
return
SWITCH(
    TRUE(),
_select in {2,5,6},_age1 &"-"& _age2,
_select in {3,4} ,_age3 &"-"& _age1)

3. Result:

When Attribute=2 is selected, it is displayed as:

vyangliumsft_1-1629355903279.png

When Attribute= 3 is selected, it is displayed as:

vyangliumsft_2-1629355903281.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Anonymous , Power Bi Axis has come from some static columns at the end. while you can create a measure with those values. I doubt you can use that on axis

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors