The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
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
Solved! Go to Solution.
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] )
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.
Best regards,
Yuliana Gu
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] )
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.
Best regards,
Yuliana Gu