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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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