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.
I have a set of data where for each [YYYYWW], there is a [utilization %] value (there are 3 "locations" (sets) in the legend, but this shouldn't affect the x-axis). The [YYYYWW] is a column formatted as:
YearWeek = INT([Yr]&Format([Wk],"00"))
This gives the correct format. I have it set to whole number for the data type. However, as seen in the picture below, the ordering is incorrect and seems arbitrary.
If I set the x-axis type to "continuous", it seems to order them correctly, but then it leaves a large gap for the transition between 201752 and 201801. Whats the best way to format this so that it orders them correctly, but doesn't leave a gap?
Solved! Go to Solution.
The sorting as text will work as you have created a proper yearweek value.
The data type should be text.
X axis type: categorical
Sort Visual by yearweek.
Similar example: You see that I do not have a gap between 200812 and 200901...
Hi BDibuz,
You need to change the x-axis property of the chart, called Type. Change it from Continuous to Categorical. Then it should look OK.
Thanks for the response; however, to clarify, the first image in my post is what happens when it is set to "categorical". It displays the x-axis values in a random order. I have also gone to the Modeling tab and selected Sort by Column - > YearWeek. This doesn't help.
Oh, and you should also change it to type Text instead of whole number. And sort the Visual by the YearWeek column.
Unfortunately, this still doesn't give the correct ordering (I also worry that this would result in lexicographical ordering instead of numerical). Maybe this sample set of the source table will help determine why:
The plot is set up as such:
The sorting as text will work as you have created a proper yearweek value.
The data type should be text.
X axis type: categorical
Sort Visual by yearweek.
Similar example: You see that I do not have a gap between 200812 and 200901...
Ok, I got this to work. I think the last piece of the puzzle was using the sorting selector in the visual and not in the Modeling tab. Thank you
Good to hear that it worked for you! Thanks.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |