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
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
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.