Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I am sharing my Pbix here.
I am trying to sort bar graph based on hour.
For instance, it will start from 12:00 AM --> 1:00 AM ..... 10:00 PM --> 11:00 PM.
Currently, it is sorted in the count.
Currently, the "Hour" column is created using text data type.
And "HourOrig" field (data type = Whole number) is created using this date/time field ("IncidentData").
How do I go about doing this?
The reason I created "Hour" as text is to show ".. PM" or ".. AM".
But now, how do I sort properly (12:00 AM --> 11:00 PM)?
Thanks in advance.
Solved! Go to Solution.
Hi @JustinDoh1 ,
The type of column Hour1 is Time, so there is no option to sort. You can use column Hour as the axis of the stacked bar chart, and then sort column Hour based on column HourOrig.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
it's, in essence, of type number; thus, no worries about sorting.
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL Thanks for help.
How do I sort from 12:00 AM --> 11:00 PM?
It is currently sorting in other way.
One thing I noticed was, there is no option to select "Sort descending, Sort ascedning nor Sort by" from this visual.
Sharing my updated file here (just in case).
Hi @JustinDoh1 ,
The type of column Hour1 is Time, so there is no option to sort. You can use column Hour as the axis of the stacked bar chart, and then sort column Hour based on column HourOrig.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.