March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
I have the following senario. There are values for workday, weekend and holidays:
Holiday Name | Day of the week | Date | Amount |
Saturday | 26-Jun-21 | 50 | |
Sunday | 27-Jun-21 | 50 | |
Monday | 28-Jun-21 | 200 | |
Tuesday | 29-Jun-21 | 100 | |
Wednesday | 30-Jun-21 | 50 | |
Canada Day | Thursday | 01-Jul-21 | 150 |
Friday | 02-Jul-21 | 300 | |
Saturday | 03-Jul-21 | 200 | |
Sunday | 04-Jul-21 | 100 | |
Monday | 05-Jul-21 | 450 | |
Tuesday | 06-Jul-21 | 400 | |
Wednesday | 07-Jul-21 | 50 |
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 Name | Day of the week | Date | Amount | New Amount |
Monday | 28-Jun-21 | 200 | 300 | |
Tuesday | 29-Jun-21 | 100 | 100 | |
Wednesday | 30-Jun-21 | 50 | 50 | |
Friday | 02-Jul-21 | 300 | 450 | |
Monday | 05-Jul-21 | 450 | 750 | |
Tuesday | 06-Jul-21 | 400 | 400 | |
Wednesday | 07-Jul-21 | 50 | 50 |
Is there a way to do this?
Solved! Go to Solution.
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
Proud to be a Super User!
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
Proud to be a Super User!
Thank you for the solution. It works well.
@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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |