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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. 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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.