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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rschaudhr
Resolver II
Resolver II

Show workdays only and add all weekend and holidays data to the next workday

I have the following senario. There are values for workday, weekend and holidays:

 

Holiday NameDay of the weekDateAmount
 Saturday26-Jun-2150
 Sunday27-Jun-2150
 Monday28-Jun-21200
 Tuesday29-Jun-21100
 Wednesday30-Jun-2150
Canada DayThursday01-Jul-21150
 Friday02-Jul-21300
 Saturday03-Jul-21200
 Sunday04-Jul-21100
 Monday05-Jul-21450
 Tuesday06-Jul-21400
 Wednesday07-Jul-2150

 

What I was to do is show only workdays (remove any weekdays and holidays). However, add the values from weekend and holidays to the next workday. So, the above file should look like the following:

 

Holiday NameDay of the weekDateAmountNew Amount
 Monday28-Jun-21200300
 Tuesday29-Jun-21100100
 Wednesday30-Jun-215050
 Friday02-Jul-21300450
 Monday05-Jul-21450750
 Tuesday06-Jul-21400400
 Wednesday07-Jul-215050

 

Is there a way to do this?

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@rschaudhr 

here is a workaround for you

Column = 
VAR last=maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])-1),'Table'[Amount])
VAR last2=maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])-2),'Table'[Amount])
VAR holiday=maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])-1),'Table'[Holiday Name])
return if('Table'[Holiday Name]<>""||'Table'[Day of the week]="Saturday"||'Table'[Day of the week]="Sunday",blank(),if('Table'[Day of the week]="Monday",'Table'[Amount]+last+last2,if(holiday<>"",'Table'[Amount]+last,'Table'[Amount])))

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Thank you for the solution. It works well. 

View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@rschaudhr 

here is a workaround for you

Column = 
VAR last=maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])-1),'Table'[Amount])
VAR last2=maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])-2),'Table'[Amount])
VAR holiday=maxx(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])-1),'Table'[Holiday Name])
return if('Table'[Holiday Name]<>""||'Table'[Day of the week]="Saturday"||'Table'[Day of the week]="Sunday",blank(),if('Table'[Day of the week]="Monday",'Table'[Amount]+last+last2,if(holiday<>"",'Table'[Amount]+last,'Table'[Amount])))

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you for the solution. It works well. 

amitchandak
Super User
Super User

@rschaudhr , You can create these columns in your date table

 

Work Day = if(WEEKDAY([Date],2)>=6,0,1)
Work Date = if(WEEKDAY([Date],2)>=6,BLANK(),[Date])
Work Date Cont = if([Work Day]=0,maxx(FILTER('Date',[Date]>EARLIER([Date]) && [Work Day]<> EARLIER([Work Day]) ),[Date]),[Date])

 

User Work Date Cont  in your analysis

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.