Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
This is the situation:
HourDiff is a calculated columns (so are DT101 and DT311):
Now I want to adjust Hourdiff to exclude Week Day Nr 6 and 7. Or use < 6.
Or exclude Week Day Sun and Sat, I do not really mind how.
How would I change the calculated column HourDiff to only take the datediff of weekdays?
Solved! Go to Solution.
Ok got my workaround to work.....
This seems to work :
In my table I made calculate columns for the start and end day as follows :
@v-yilong-msft well I would think there were better solutions than mine.
But if there are no others I will mark that one as a solution.
In fact I think I made a better solution myself using a calculated column called weekendcorrection like:
Ok got my workaround to work.....
This seems to work :
In my table I made calculate columns for the start and end day as follows :
Hi @rpinxt ,
I think it's perfect that you're using this method to make it easier and meet your needs, so have you solved your problem so far? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!
Best Regards
Yilong Zhou
@v-yilong-msft well I would think there were better solutions than mine.
But if there are no others I will mark that one as a solution.
In fact I think I made a better solution myself using a calculated column called weekendcorrection like:
Trying a workaround here but there should be an easier way I would think....however.
Made this in a test excel based on 1 line of data :
As you see this would work. I recognizes that a weekend had past and subtracts 48 hours.
But if I try to incorp this in my model with multiple lines of data :
As you see it does not see that it is a Friday and a Monday (5 and 1).
For sure it has to do with the MAX formula in the _StartDay and _EndDay variables because there are more lines of data now.
Does anybody know how I can avoid this??
Ps: still would think there should be better solution for this whole problem....
Try
Calculate(DIVIDE(DATEDIFF(SC2[DT101],SC2[DT311],MINUTE),60), Weekday(`Date Column`, 2) <6)
This will calculate the number of hours while filtering the days that are Saturday(6) or Sunday(7).
Thanks @ChiragGarg2512 but something is not quite alright:
DT101 and DT311 are also calculated colunns so I guess something is different then.
Should I wrap them in MAX ?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
103 | |
101 | |
76 | |
66 | |
60 |
User | Count |
---|---|
142 | |
106 | |
103 | |
85 | |
70 |