Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Solved! Go to Solution.
Hi @Lihobday,
Smoupre's solution seems well, you can also take a look at below formula, I add the condtion to replace blank value to current date.
WorkDay Count = COUNTROWS ( FILTER ( ADDCOLUMNS ( CALENDAR ( [Assigned date], IF ( [Actual briefing date] <> BLANK (), [Actual briefing date], TODAY () ) ), "DayofWeek", WEEKDAY ( [Date], 1 ) ), [DayofWeek] <> 1 && [DayofWeek] <> 7 ) )
Original table:
Result:
Regards,
Xiaoxin Sheng
Hi @Lihobday,
If 'brief date' and 'actual close date' both not blank, which one you'd like to calculate?
In my opinion, I will choose the smaller one as the end date parameter:
WorkDay Count = VAR closedate = MIN ( [Actual close date], [Actual briefing date] ) RETURN COUNTROWS ( FILTER ( ADDCOLUMNS ( CALENDAR ( [Assigned date], IF ( closedate <> BLANK (), closedate, TODAY () ) ), "DayofWeek", WEEKDAY ( [Date], 1 ) ), [DayofWeek] <> 1 && [DayofWeek] <> 7 ) )
Notice: min and max function will ignore blank value.
Regards,
Xiaoxin Sheng
Hi @Lihobday,
Smoupre's solution seems well, you can also take a look at below formula, I add the condtion to replace blank value to current date.
WorkDay Count = COUNTROWS ( FILTER ( ADDCOLUMNS ( CALENDAR ( [Assigned date], IF ( [Actual briefing date] <> BLANK (), [Actual briefing date], TODAY () ) ), "DayofWeek", WEEKDAY ( [Date], 1 ) ), [DayofWeek] <> 1 && [DayofWeek] <> 7 ) )
Original table:
Result:
Regards,
Xiaoxin Sheng
Thank you for the solution XiaoXin Sheng! This work wonders!!! Had been figuring this out for a long time...!
Hi v-shex,
I have another problem that require some help.
1. I have another column Close Date that has been added. How may i calculate by working days the difference between actual Close date and Brief date. The challenge is sometimes brief date field will be left blank. And i will get error from POWERBI "The start date or end date in Calendar Function can not be Blank value"
Is it possible to have a fomulae that calculates only if there is an entry in "Brief date" else it will not calculate?
Thank you!!
Hi @Lihobday,
If 'brief date' and 'actual close date' both not blank, which one you'd like to calculate?
In my opinion, I will choose the smaller one as the end date parameter:
WorkDay Count = VAR closedate = MIN ( [Actual close date], [Actual briefing date] ) RETURN COUNTROWS ( FILTER ( ADDCOLUMNS ( CALENDAR ( [Assigned date], IF ( closedate <> BLANK (), closedate, TODAY () ) ), "DayofWeek", WEEKDAY ( [Date], 1 ) ), [DayofWeek] <> 1 && [DayofWeek] <> 7 ) )
Notice: min and max function will ignore blank value.
Regards,
Xiaoxin Sheng
Create a custom column in your data table:
Calc Date = IF(ISBLANK([AssignedDate]),TODAY(),[AssignedDate])
Use that to calculate working days.
Use conditional formatting in a table visualization to show yellow and red values.
Thank you Smoupre!
User | Count |
---|---|
84 | |
75 | |
69 | |
48 | |
39 |
User | Count |
---|---|
111 | |
56 | |
50 | |
42 | |
40 |