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
need a help to create networking days in each month .
I have master table in which a column called "workdate". work date starts from 01-01-2021 to 12-31-2021.
I have another table which having the holidays details. i need to find the networking days of each month considering weekends and holidays. please help me.
New Year's Day | Jan 01, 2021 (Fri) |
Republic Day | Jan 26, 2021 (Tue) |
Ramzan Id/Eid-ul-Fitar | May 14, 2021 (Fri) |
Diwali / Deepavali | Nov 04, 2021 (Thu) |
Christmas Eve | Dec 24, 2021 (Fri) |
Solved! Go to Solution.
Hi, @ashik1992
To create 2 calculated columns(holiday column, weekNum column)in master table.
holiday = RELATED(Holiday[holiday])
dayNum = WEEKDAY('MasterTable'[Date],2)
then create 2 measures (isNetworkday, Count).
_isNetworkday =
var _if=IF(MAX('MasterTable'[holiday])=BLANK()&&NOT(MAX(MasterTable[dayNum])in{6,7}),1)
return _if
_Count =
var _monthTable=FILTER(ALL('MasterTable'),'MasterTable'[Month]=MAX('MasterTable'[Month]))
var _sum=SUMX(_monthTable,[_isNetworkday])
var _a=SUMMARIZE('MasterTable',[Month],"value",_sum)
return SUMX(_a,[value])
so the result would be like this:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @ashik1992
To create 2 calculated columns(holiday column, weekNum column)in master table.
holiday = RELATED(Holiday[holiday])
dayNum = WEEKDAY('MasterTable'[Date],2)
then create 2 measures (isNetworkday, Count).
_isNetworkday =
var _if=IF(MAX('MasterTable'[holiday])=BLANK()&&NOT(MAX(MasterTable[dayNum])in{6,7}),1)
return _if
_Count =
var _monthTable=FILTER(ALL('MasterTable'),'MasterTable'[Month]=MAX('MasterTable'[Month]))
var _sum=SUMX(_monthTable,[_isNetworkday])
var _a=SUMMARIZE('MasterTable',[Month],"value",_sum)
return SUMX(_a,[value])
so the result would be like this:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@ashik1992 I created this:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/td-p/367362
I have an improved version in my book, DAX Cookbook, recipe 10 in chapter 2. gdeckler/DAXCookbook (github.com)
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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |