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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Aucesar
Helper III
Helper III

Show and sort week period

 

Hi Community,

 

I´m trying to create a new column with week days like the image below, I could do that using a DAX from the forum but I can´t sort it in chronological order.

 

I tried to sort the new column with week number but I got a error saying "There can´t be more than one value in....."

No worries if the solution use another DAX solution, thanks.

sort-by-date.png

 

sampledata.pbix 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Aucesar ,

Week start date can help to sort

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

 

Week Start Adjusted = if([Week Start date] < (eomonth([Date],-1)+1), (eomonth([Date],-1)+1), [Week Start date])

 

You can mark  Week Start Adjusted as a sort column or

YYMM Week Start Adjusted  = format([Week Start Adjusted], "YYYYMM")

 

YYMM Week Start Adjusted as sort column for week range

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
VK_nz
Helper I
Helper I

@amitchandak  this has helped a lot.. was stuck at it and found your solution working perferct. Thank you

amitchandak
Super User
Super User

@Aucesar , Week start date can help to sort

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

 

Week Start Adjusted = if([Week Start date] < (eomonth([Date],-1)+1), (eomonth([Date],-1)+1), [Week Start date])

 

You can mark  Week Start Adjusted as a sort column or

YYMM Week Start Adjusted  = format([Week Start Adjusted], "YYYYMM")

 

YYMM Week Start Adjusted as sort column for week range

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@Aucesar ,

Week start date can help to sort

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

 

Week Start Adjusted = if([Week Start date] < (eomonth([Date],-1)+1), (eomonth([Date],-1)+1), [Week Start date])

 

You can mark  Week Start Adjusted as a sort column or

YYMM Week Start Adjusted  = format([Week Start Adjusted], "YYYYMM")

 

YYMM Week Start Adjusted as sort column for week range

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Dear @amitchandak 
Thanks for the super fast reply and working solution!!!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors