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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
bourne2000
Helper V
Helper V

How to sort week end date in the date table?

Hi

 

I have below date table

 

bourne2000_0-1674267566648.png

 

 

I created Week End date using this dax measure

Week End Date = 'Date'[Date] - WEEKDAY('Date'[Date],2) + 7

 

I need to sort the week end date, as I build the bar chart using week end date as an axis but it's not sorted out

 

bourne2000_1-1674267684016.png

 

Can anyone advise the following?

 

1) How to sort the week end date?

2) Hot to format week end date into "MM/dd/YYYY"

 

 

 

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @bourne2000 

Click the End Date column, then change it date type to short date

 

 

vxinruzhumsft_2-1674546989921.png

 

Then put the column to the axis.

and use the sort function in visual

vxinruzhumsft_3-1674547039843.png

 

Output:

vxinruzhumsft_4-1674547067787.png

Best Regards!

Yolo Zhu

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

View solution in original post

4 REPLIES 4
v-xinruzhu-msft
Community Support
Community Support

Hi @bourne2000 

Click the End Date column, then change it date type to short date

 

 

vxinruzhumsft_2-1674546989921.png

 

Then put the column to the axis.

and use the sort function in visual

vxinruzhumsft_3-1674547039843.png

 

Output:

vxinruzhumsft_4-1674547067787.png

Best Regards!

Yolo Zhu

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

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FreemanZ
Super User
Super User

hi @bourne2000 

1) try to click the "...", sort by

https://learn.microsoft.com/en-us/power-bi/consumer/end-user-change-sort

2)

try like:

Week End Date = FORMAT('Date'[Date] - WEEKDAY('Date'[Date],2) + 7, "mm/dd/yyyy")

@FreemanZ  Thanks. I used the measure and it changed into mm/dd/yyyy. However, it is not sorting. I used sort by but it's not showing correct sort. I have data from 2022 to 2023. It showing mixed axis

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.