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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MaryEliz21
Regular Visitor

Sorting a graph

I have a set of data that reads latest weeks end 1/21/24, latest 4 weeks ending 1/21/24, latest 13 weeks ending 1/21/24 for multiple brands. The date will change every week. How do I get my graph to sort these in the correct order? It wants to put all the latest 4 together, latest 13 together, etc.

 

Thank  you!!!!

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

See if my solution in the attached file helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @MaryEliz21 ,

 

Not quite sure what your intentions are. But you can refer to the following schedule:

vtianyichmsft_0-1706753341127.png

DimDate = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthSort", MONTH ( [Date] ),
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "WeekDay", WEEKDAY ( [Date],2 ),
    "WeekStart",[Date] - WEEKDAY ( [Date], 2 ) + 1,
    "WeekSort",WEEKNUM([Date],1)
)

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

See in the below screen shot the weeks at the bottom of the chart. I need to get the dates in order, while keeping the 4 weeks in front of the dates. 

 

image.png

Anonymous
Not applicable

Hi @MaryEliz21 ,

 

Create the appropriate date table and pass the sort by column

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors