Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a table with some null data, and am plotting it by year/month. Even though the X axis is sorted by year / month (so 201801, 201802, etc), all the months/years with no data are coming first, even though they're later than the months/years with data. Pic attached.
Solved! Go to Solution.
Hi, @ipelly
According to your description, I can understand clearly what you want to get, I think you can achieve this using another calculate column to sort the [Year month] column, you can try my steps:
Yearmonth = YEAR([Date])&FORMAT([Date],"mm")Sort column = YEAR([Date])&FORMAT([Date],"mm")
Then change them to different data type, one “Whole number” and one “Text”, like this:
And you can get what you want
You can download my test pbix file here
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @ipelly
According to your description, I can understand clearly what you want to get, I think you can achieve this using another calculate column to sort the [Year month] column, you can try my steps:
Yearmonth = YEAR([Date])&FORMAT([Date],"mm")Sort column = YEAR([Date])&FORMAT([Date],"mm")
Then change them to different data type, one “Whole number” and one “Text”, like this:
And you can get what you want
You can download my test pbix file here
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 57 | |
| 44 | |
| 40 | |
| 21 | |
| 18 |