Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
ThisIsIt
Frequent Visitor

Weekday Sort by Date

Hello Everyone!  Hoping you can help.

 

I have a column I created that gets the Day of Week from a Date.  I'd like to sort that Day of Week in my visual by date from oldest to newest and not by weekday.  I'm tyring to show the last 7 days but by Weekday instead of an actual date, but the Weekday either sorts alphabetically or numberically (1, 2, 3, ect..).  How can I get it to sort by the actual date?

 

Note, that I'm working in Direct Query

 

Thank you!

5 REPLIES 5

Hi @ThisIsIt ,

 

quick and dirty.

Put the date in the tooltip and sort by the Earliest date.

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hi @ThisIsIt ,

 

has your question been answered?

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


JarroVGIT
Resident Rockstar
Resident Rockstar

You can change the 'Sort by' of a column. In your case, you could create a new table with daynumber - dayname rows (so 7 rows), and then create a relationship between that table and you real table. (based on dayname). Then select the dayname column (in Dataview), and select 'Sort by' daynumber. In your visual, insert the dayname column of the new table as axis, and values from your original table. Then sort the visual on dayname (which sorts it to daynumber).:

 

image.png

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Unless I'm missing what you are saying, I'm actually trying to sort by Date and not Number.  I have my visual set for a relative date of 1 week.  I'd like to have the most recent date to the right and the oldest to the left, but displayed by WeekDay instead of date.  I tried selecting the WeekDay column and changing the sort by from the modeling tab but it threw an error (see below).

 

These should be reversed if sorted correctly by Date as opposed to WeekDay NameThese should be reversed if sorted correctly by Date as opposed to WeekDay Name2019-12-13_20-07-04.png

 

 

Hi  @ThisIsIt ,

 

according to my understanding, @JarroVGIT suggestion is right.

First on power query, arrange your date in ascending order or descending order

Then have an index column that corresponds to your Weekname.

Then on Modeling tab, you can use the sort the week by the index column you made.

or

 

Simply have a date table.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.