Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello, I am fairly new to Power BI and to this forum (first post). I need to add a column that adds a fixed number (e.g. 15) of working days to a date that is already in my table. In Excel, I use =WORKDAY([Date],15,[Holidays]), but I cannot figure out how to get the equivalent output in Power BI. I am able to add a certain number of days (using Date.AddDays([Date], 15), but would really need to add working days. Any help would be appreciated.
hu9uest.
Solved! Go to Solution.
Hi @huguest,
After research and test, there is no a function used to achieve same requirement in Power BI. You can follow the following to solutions.
1.You can calculated them in Excel, then load the data to PowerBI.
2. Create a Canlendar table. The start_date is your min(facttable[date]), and end_date your max(facttable[date]).
CALENDAR(<start_date>, <end_date>)
In Calendar table, create calculated column to display the day if it is work day, rank all working days, get the result based on calculated columns. For example, I add futher 10 working days.
Identify = IF(OR(WEEKDAY(Canlendar[Date])=1, WEEKDAY(Canlendar[Date].[Date])=7),0,1) Rank1 = RANKX(FILTER(Canlendar,Canlendar[Identify]=1),Canlendar[Date],,ASC) Add 10 woring days = LOOKUPVALUE(Canlendar[Date],Canlendar[Identify],1,Canlendar[Rank1],Canlendar[Rank1]+10)
Create a relationship batween Calendar and your fact table. Use the related function to get the result in fact table.
Result=RELATED(Calendar[Add 10 woring days])
If you have other issues, please feel free to ask.
Best Regards,
Angelia
How i can exclude Holiday list in same formula?
Hi @huguest,
After research and test, there is no a function used to achieve same requirement in Power BI. You can follow the following to solutions.
1.You can calculated them in Excel, then load the data to PowerBI.
2. Create a Canlendar table. The start_date is your min(facttable[date]), and end_date your max(facttable[date]).
CALENDAR(<start_date>, <end_date>)
In Calendar table, create calculated column to display the day if it is work day, rank all working days, get the result based on calculated columns. For example, I add futher 10 working days.
Identify = IF(OR(WEEKDAY(Canlendar[Date])=1, WEEKDAY(Canlendar[Date].[Date])=7),0,1) Rank1 = RANKX(FILTER(Canlendar,Canlendar[Identify]=1),Canlendar[Date],,ASC) Add 10 woring days = LOOKUPVALUE(Canlendar[Date],Canlendar[Identify],1,Canlendar[Rank1],Canlendar[Rank1]+10)
Create a relationship batween Calendar and your fact table. Use the related function to get the result in fact table.
Result=RELATED(Calendar[Add 10 woring days])
If you have other issues, please feel free to ask.
Best Regards,
Angelia
Can you show me how to do this?
2. Create a Canlendar table. The start_date is your min(facttable[date]), and end_date your max(facttable[date]).
CALENDAR(<start_date>, <end_date>)
How can i exclude Holiday list in above formula?
I know this is a bit of a dated post but when I used the above formulas I am getting blanks for "add working days"
@v-huizhn-msft Is it possible to add also the time for the business days? Like I have the date 1-Oct-2021 9:39 PM and I need to add 5 business days to it but the result will look like 8-Oct-2021 12:00 AM. Instead I need the time to show the actual end of business day, like 6pm for example. Is it possible based on your solution?
Thanks
Emanuel
Hi,
I am facing some challenges: the formula for adding 'n' days doesn't show a future date or the date which is the last row in the 'Date' column.
If the last date 24-JUN-2021, then adding 5 days should show 1-JUL-2021, but the last entry which I am getting in 'Add 5 working days' column is 17-JUN-2021.
Attaching the screenshot for your reference.
Can you please help me with some tips?
@anchitsahay I had the same problem and is related to the end date you have configured in you calendar. Add a year to your end date calendar and this is fixed.
Hope this helps
I have done in the same way and given relation between the calendar and fact table but then also when i write releated i am getting blank value. i am pasting my formula in the below. kindly help me where i am doing the mistake.
is there a way i can do a reversal on the same thing that you explained above - I have a date table and i am able to calculate working days.(0s for weekends and 1's for Weekdays). I need to add 5 days to my start date and and pick the appropriate working date from the date table so that it gives me an "Expected Completion Date" that takes account of weekends.
Hi Angelia,
Could you elaborate more on the below function (ASC?) or share me the image of the "rank 1" the full complete dax code (as what you did for Add 10 woring days ) because I stucked on this step,thanks.
Rank1 = RANKX(FILTER(Canlendar,Canlendar[Identify]=1),Canlendar[Date],,ASC)
This really helped me! Thank you very much
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
102 | |
98 | |
38 | |
37 |
User | Count |
---|---|
152 | |
125 | |
75 | |
74 | |
63 |