Forum Discussion
DAX Add Custom Column, Date Duration minus WeekEnds
- 6 years ago
Note that I have managed to find a solution from a previous post; NETWORKDAYS in PowerQuery Editor [Super User IV, Mariusz], from the downloaded example file; duration with no weekends and holidays.pbix
community.powerbi.com/t5/Power-Query/NETWORKDAYS-in-PowerQuery-Editor/td-p/940950
Note that my table calculated column that I am using that gives whole days is as below.
If I change the data type to decimal it just gives e.g. 10.0 My aim is to achieve days as e.g. 9.6
SLA Days = VAR Created =
MAX (Table[StartDate])
VAR Closed =
MAX (Table[EndDate])
RETURN
CALCULATE (
SUM ( 'Date'[IsWorkDay] ),
FILTER (
ALL ( 'Date'[Date] ),
'Date'[Date] >= [StartDate]
&& 'Date'[Date] <= [Created]
)
)
Hi Allan (Microsoft), Are you able to attach a sample scenario pbix file, so I can see where I am going wrong.
I followed your instrucions exactly, and cannot see why I am getting an error.
Thanks Peter
- v-alq-msft6 years ago
Community Support
- PeteD13026 years ago
Helper I
Hi Alan (at Microsoft), Thanks for the sample file, that helped a lot, one step closer to a solution.
I have tested with 2 sets of date formatted data, one with Date [works OK], the other with Date/Time; this one has an error message.
I really need my result in part days, not whole days.
Do you have any suggestions.- v-alq-msft6 years ago
Community Support
Hi, PeteD1302
I'd like to suggest you use datetime data type as the parameters. You need to use List.DateTimes function instead of List.Date.
Best Regards
Allan