The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Can anyone please help?
What I want to do is create a nextwork days column within my data (Table.cases) which will show me the correct amount of days on each item number (Ref) between Date1 and Date2.
The example shown is how the data looks like within Table.cases, I also have a Calendar table in which I created which will flag workday which will flag up if the day is not a holiday or a weekend as 1.
I have so far used a date diff and then tried to remove the sum on the days as 1 in the calendar but it want correct as they were not associating.
Ref | Days1 | Days2 | Wanted new column date diff without workday |
151215 | 01/02/2018 | 11/05/2019 | |
1515151 | 05/08/2018 | 12/06/2019 | |
1515151 | 20/08/2018 | 20/12/2020 | |
1551515 | 11/09/2019 | 20/12/2020 |
Solved! Go to Solution.
@jaltoft , refer this for Power Query /M
https://www.thebiccountant.com/2020/02/20/date-networkdays-function-for-power-query-and-power-bi/
DAx -https://www.sqlbi.com/articles/counting-working-days-in-dax/
I found a solution I haven't seen used for anyone interested.
If you have a DateTable that takes note of holidays and weekends by date, then for any give date, we can calculate the difference between dates using some sneaky logic.
So if you have a date table as below screenshot shown. Create a Key No. 1 column
Next, create an index column using a running total formula.
I found a solution I haven't seen used for anyone interested.
If you have a DateTable that takes note of holidays and weekends by date, then for any give date, we can calculate the difference between dates using some sneaky logic.
So if you have a date table as below screenshot shown. Create a Key No. 1 column
Next, create an index column using a running total formula.
@jaltoft , refer this for Power Query /M
https://www.thebiccountant.com/2020/02/20/date-networkdays-function-for-power-query-and-power-bi/
DAx -https://www.sqlbi.com/articles/counting-working-days-in-dax/
@amitchandak im not sure this answers my issue? Can the function be used in the calculated column? As the original question?
Thanks for the reply. Can you help?
Hello @amitchandak ive now had a look at your Dax link. That proved a perfect solution thanks.
Hello that looks good but can I use the function in the new calculated column? I have never used them within PowerBi previously.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
80 | |
71 | |
52 | |
50 |
User | Count |
---|---|
129 | |
123 | |
78 | |
64 | |
60 |