Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I currently have a table called 'Flights', which contains one row per unique flight. The table contains different columns, including 'Origin Airport' and 'Destination Airport'. I would like to create a visualization showing the number of flights (Y-axis) per airport (X-axis). Instead of making two separate visualizations (one for origin airports and one for destination airports), I would like to combine both visualizations and let users decide if they want to see destination or origin airports based on a slicer. This basically means that the X-axis should use a different column based on the slicer selection. I have tried several solutions from both this forum and Google but every case I find seems to be a little bit different...
Thanks in advance!
Solved! Go to Solution.
For the moment, you cannot make dynamic X axis in Power BI because measures are still not accepted as axis (except in scatter charts).
You can use this trick though:
You pick a chart (let's say a histogram) with two columns in the X-Axis: The airport origin column and the destination column;
And then, you can play with the hierarchy of the graph to switch between origin and destination airports:
This one got my creative side going as I have data like this so I wanted to see if there was a way around the limitation!
By creating summary tables and then using union to join the two summary tables together and a disconnected slicer I was able to achieve something that works!
Here's the pbix if you'd like to see how I went about it FlightDiary.pbix The data is pretty boring as I tend to flight from and to the same airports but you can see things change for some airports.
For the moment, you cannot make dynamic X axis in Power BI because measures are still not accepted as axis (except in scatter charts).
You can use this trick though:
You pick a chart (let's say a histogram) with two columns in the X-Axis: The airport origin column and the destination column;
And then, you can play with the hierarchy of the graph to switch between origin and destination airports:
Please accept as a solution so the whole community can benefit from our conversation and see it is actually solved 🙂
Thanks.
Thanks, this will do for now. If anyone has a solution which allows for a 'real' slicer, please let me know. 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |