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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
dombarg
Helper II
Helper II

change X-Axis by slicer in reverse order

hello my freinds.

I have a simple data set and bar chart in which i need to graph X-axis dynamically by slicer.

i,d  used method described by @OwenAuger in following post:

Link

 

what i strugling with for many hours is that how to change X-axis in reverse order.indeed, when user select "Region" in slicer, X-axis should be "year"  and when user selects "year", Axis shows "region"

my solution was changing in "regionYear" Table = changing postion of year and region in Axis Value column.

it was ok, but the problem arise when i need to inser some other chart like pie,table and ... and want to show Slicer value with right order.

how can i do this?is there any solution?

thank u

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @dombarg,

 

You can create a reverse order column, meanwhile keep the original Axis Value column.

reverse Axis Dimension =
IF (
    RegionYear[Axis Dimension] = "Region",
    FORMAT ( RegionYear[Year], "" ),
    RegionYear[Region]
)

1.PNG

 

To achieve the result that ' when user select "Region" in slicer, X-axis should be "year"  and when user selects "year", Axis shows "region" ', please add reverse order column into chart Axis, and add below measure into Values sectionof chart.

Sales Amount Flexible Axis reverse = 
IF (
    NOT ( ISBLANK ( [Axis Dimension Selected] ) ),
    SWITCH (
        [Axis Dimension Selected],
        "Year",
        CALCULATE (
            [Sales Amount],
            USERELATIONSHIP ( RegionYear[Region], Region[Region] )
        ),
        "Region",
        CALCULATE (
            [Sales Amount],
            USERELATIONSHIP ( RegionYear[Year], 'Year'[Year] )
        )
    )
)

While for some other charts, to let them to show Slicer values with right order, please add [Axis Value] into axis.

 

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @dombarg,

 

You can create a reverse order column, meanwhile keep the original Axis Value column.

reverse Axis Dimension =
IF (
    RegionYear[Axis Dimension] = "Region",
    FORMAT ( RegionYear[Year], "" ),
    RegionYear[Region]
)

1.PNG

 

To achieve the result that ' when user select "Region" in slicer, X-axis should be "year"  and when user selects "year", Axis shows "region" ', please add reverse order column into chart Axis, and add below measure into Values sectionof chart.

Sales Amount Flexible Axis reverse = 
IF (
    NOT ( ISBLANK ( [Axis Dimension Selected] ) ),
    SWITCH (
        [Axis Dimension Selected],
        "Year",
        CALCULATE (
            [Sales Amount],
            USERELATIONSHIP ( RegionYear[Region], Region[Region] )
        ),
        "Region",
        CALCULATE (
            [Sales Amount],
            USERELATIONSHIP ( RegionYear[Year], 'Year'[Year] )
        )
    )
)

While for some other charts, to let them to show Slicer values with right order, please add [Axis Value] into axis.

 

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors