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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
CracktheCode85
Helper II
Helper II

How to show working days for each month over two years in chronological order

Hello! 

I'm trying to sort my weekdays as 1,2,3,4,5 etc... per month in BI. I built a custom Spreadsheet that identifies the workdays (and excludes holidays) for 2023 and 2024. The column is labeled "Ref Days"

The relationship of this date source and the SQL data source are working correctly as I've been able to match the numbers for each day to the penny, however I am unable to sort the days in chronological order. 

When I try to sort by index, or a merged column i created i get the error that it won't be able to sort due to non unique values in the "Ref Days" column.... 

 

Looking for advice and guidance on how I can achieve this. 
Sorting Issue 1.png

 

Here is my table that I've tried to sort columns from:

Date Table To Sort By.png

1 ACCEPTED SOLUTION
CracktheCode85
Helper II
Helper II

I was able to solve this by adjusting my date table source. Adding a "0" before any single integer like "Day 01, Day 02" and so forth for each month across the two year period. Since doing that the data and visuals are acting correctly. 
I truly appreciate the help! 

View solution in original post

6 REPLIES 6
CracktheCode85
Helper II
Helper II

I was able to solve this by adjusting my date table source. Adding a "0" before any single integer like "Day 01, Day 02" and so forth for each month across the two year period. Since doing that the data and visuals are acting correctly. 
I truly appreciate the help! 

Ritaf1983
Super User
Super User

Hi @CracktheCode85 
You need to create a column that will be "unique for the order"  and then sort ref day by this column.
In your case maybe it is a day number concatenated to a year number, something like :
20231

20232

20233

20234

....

20241

To make sure I need more data.
Try to use my suggestion and if it is not please share a link to the dummy pbix without sensitive data.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks Rita! 
I put that into test and couldn't sort it.... This is the error I keep getting:

CracktheCode85_0-1706887145144.png

 

This is the closest to a solution I can find thus far but the "Earlier" Function is not working for me in my dataset 😕 
Solved: Re: Power BI to show workday for each day in the m... - Microsoft Fabric Community

Hi @CracktheCode85 
As I mentioned to help more 

I need more data.
please share a link to the dummy pbix without sensitive data.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

I would love to but I'm not sure how to do that. Is there a public server I can upload to? Like with Tableau? 
(Sorry I'm new to Power BI) 

You can save it on google drive/ one drive etc and share via link

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.