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

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.

Reply
Anonymous
Not applicable

Axis Range change dynamically Based on slicer value

Hello,

 

I have a requirement to take a survey of the population based on age. While using slicers from 0 to 10, the x-axis value of the chart show 0-10,10-20,20-30...etc.based on ages in data .Likewise, my slicer value is 0 to 30 means, the x-axis value of the chart show 0-30,60-90,....etc.In X-axis the age should show data dynamically based on slicer values.WhatsApp Image 2021-08-03 at 12.06.12 PM.jpeg

 

 

 This is a sample of what I want to do. Please help to rectify this one. Thanks in Advance.

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Sorry...You may create a new thread in Power BI Desktop Community to get further help.😅

 

Best Regards,
Eyelyn Qin

 

Anonymous
Not applicable

Hi @Anonymous ,

 

Based on my test, I created two Range tables and used Bookmarks to realize your scenario.

 

Here is my data samples.

all needed tables.PNG

Step1:  Create two measures for each range:

Range is 10 =
SWITCH (
    MAX ( 'Range(10)'[Range] ),
    "0-10",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] >= 0 && 'Age Table'[Age] <= 10 )
        ),
    "10-20",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 10 && 'Age Table'[Age] <= 20 )
        ),
    "20-30",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 20 && 'Age Table'[Age] <= 30 )
        ),
    "30-40",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 30 && 'Age Table'[Age] <= 40 )
        ),
    "40-50",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 40 && 'Age Table'[Age] <= 50 )
        ),
    "50-60",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 50 && 'Age Table'[Age] <= 60 )
        ),
    "60-70",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 60 && 'Age Table'[Age] <= 70 )
        ),
    "70-80",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 70 && 'Age Table'[Age] <= 80 )
        ),
    "80-90",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 80 && 'Age Table'[Age] <= 90 )
        ),
    "90-100",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 90 && 'Age Table'[Age] <= 100 )
        )
)
Range is 30 =
SWITCH (
    MAX ( 'Range(30)'[Range] ),
    "0-30",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] >= 0 && 'Age Table'[Age] <= 30 )
        ),
    "30-60",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 30 && 'Age Table'[Age] <= 60 )
        ),
    "60-90",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 60 && 'Age Table'[Age] <= 90 )
        ),
    "90-100",
        CALCULATE (
            COUNTROWS ( 'Age Table' ),
            FILTER ( 'Age Table', 'Age Table'[Age] > 90 && 'Age Table'[Age] <= 100 )
        )
)

Step2: Create visuals on two pages and use each page as bookmark like this:

page1 as bookmark1.PNGpage2 as bookmark2.PNG

The final output is shown below:

dynamic change.gif

 

Refer to:

Create report bookmarks in Power BI to share insights and build stories - Power BI | Microsoft Docs

 

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

Anonymous
Not applicable

Hi @Anonymous 

Thanks for your response,this one make my work very easily.

One more question is there any way to use this one on same page without using bookmark,

beacause my requirement is x-axis value change dynamicaly based slicer value on same graph.I am new to power bi can you please help to get this one.

Thanks in advance

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.