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.
Hi,
How to find 4th working day of the month in Power BI.
Note: Excluding Saturday and Sunday, not holidays.
Regards,
Pavan Vanguri.
Solved! Go to Solution.
@Anonymous
Assuming you have a date table, you can add a column using the following formula. This will give the workday # of the month ignoring Saturday and Sunday. From there you can write measures that filter the DimDate table on this Workday Column
WorkDay = VAR __CurrentDate = DimDate[Date] VAR __CurrentMonth = MONTH( DimDate[Date] ) VAR __CurrentYear = Year( DimDate[Date]) VAR __Weekends = {6 ,0} RETURN IF ( NOT DimDate[Day of Week] IN __Weekends, CALCULATE( COUNTROWS( FILTER( ALL (DimDate), __CurrentMonth = MONTH( DimDate[Date]) && __CurrentYear = YEAR (DimDate[Date]) && __CurrentDate >= DimDate[Date] && NOT DimDate[Day of Week] IN __Weekends ) ) ) )
Hi @Anonymous
In adddition ro Nick_M's solution,
If you want to excluding holidays as well,
Please create a holiday table with holiday date,
then connect it to your date table,
Create two columns in your date table
Day of Week = WEEKDAY([date],3) related holiday = RELATED('holiday table'[date]) WorkDay = VAR __CurrentDate = DimDate[Date] VAR __CurrentMonth = MONTH( DimDate[Date] ) VAR __CurrentYear = Year( DimDate[Date]) VAR __Weekends = {6 ,0} RETURN IF ( NOT DimDate[Day of Week] IN __Weekends, CALCULATE( COUNTROWS( FILTER( ALL (DimDate), __CurrentMonth = MONTH( DimDate[Date]) && __CurrentYear = YEAR (DimDate[Date]) && __CurrentDate >= DimDate[Date] && NOT DimDate[Day of Week] IN __Weekends && NOT DimDate[date]= [related holiday] ) ) ) )
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
In adddition ro Nick_M's solution,
If you want to excluding holidays as well,
Please create a holiday table with holiday date,
then connect it to your date table,
Create two columns in your date table
Day of Week = WEEKDAY([date],3) related holiday = RELATED('holiday table'[date]) WorkDay = VAR __CurrentDate = DimDate[Date] VAR __CurrentMonth = MONTH( DimDate[Date] ) VAR __CurrentYear = Year( DimDate[Date]) VAR __Weekends = {6 ,0} RETURN IF ( NOT DimDate[Day of Week] IN __Weekends, CALCULATE( COUNTROWS( FILTER( ALL (DimDate), __CurrentMonth = MONTH( DimDate[Date]) && __CurrentYear = YEAR (DimDate[Date]) && __CurrentDate >= DimDate[Date] && NOT DimDate[Day of Week] IN __Weekends && NOT DimDate[date]= [related holiday] ) ) ) )
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Assuming you have a date table, you can add a column using the following formula. This will give the workday # of the month ignoring Saturday and Sunday. From there you can write measures that filter the DimDate table on this Workday Column
WorkDay = VAR __CurrentDate = DimDate[Date] VAR __CurrentMonth = MONTH( DimDate[Date] ) VAR __CurrentYear = Year( DimDate[Date]) VAR __Weekends = {6 ,0} RETURN IF ( NOT DimDate[Day of Week] IN __Weekends, CALCULATE( COUNTROWS( FILTER( ALL (DimDate), __CurrentMonth = MONTH( DimDate[Date]) && __CurrentYear = YEAR (DimDate[Date]) && __CurrentDate >= DimDate[Date] && NOT DimDate[Day of Week] IN __Weekends ) ) ) )
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |