Forum Discussion
Tahech
Helper I
4 years agoHow to change X-Axis conditionally?
My problem: I'm visualizing a graphic in Months (x-axis) by Value (y-axis). When I click over June (for example) I want to change the x-axis from "Month" to "Clients". Then my graphic will sh...
- 4 years ago
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Creating a new table.
Axis table = SELECTCOLUMNS ( UNION ( ALL ( 'Calendar'[Month-Year], 'Calendar'[End of Month] ), ALL ( Clients[Clients], Clients[Index] ) ), "@Axis", [Month-Year], "@index", 'Calendar'[End of Month] )Creating a measure
Desired outcome measure: = IF ( NOT ISFILTERED( 'Calendar'[Month-Year] ), CALCULATE ( SUM ( Data[Value] ), TREATAS ( VALUES ( 'Axis table'[@Axis] ), 'Calendar'[Month-Year] ) ), CALCULATE ( SUM ( Data[Value] ), TREATAS ( VALUES ( 'Axis table'[@Axis] ), Clients[Clients] ) ) )
themistoklis
Community Champion
4 years agoHello Tahech
Maybe the folllowing links will help:
https://addendanalytics.com/blog/dynamic-axis-based-on-slicer-selection-in-power-bi/
https://radacad.com/dynamic-x-axis-on-charts-power-bi
https://www.youtube.com/watch?v=n-OWNaCUU0o