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.
i have implemented isworking day column with the refrence of one datecolumn in a holidays refernece
IsWorkingDay = IF (NOT(DateTime[Day of Week]= "Saturday" || (DateTime[Day of Week]= "Sunday")) && COUNTX(RELATEDTABLE(Holidays),Date)<1,1,0)
Now the Holidays refrence table splited into holidaystartdate and HolidayEnddate.
How to handle this
Solved! Go to Solution.
Based on your description, now you have a holiday reference table which specifies a data range for each holiday. You want to add a isworkingday column in your date diemnsion table. Right?
I assume your Holiday table like below, and you build the relationship between two tables already:
You can apply the condition to check number of records in Holiday table where the current date is within the date range. Please create a calculated column below;
isworkingday = IF(WEEKDAY('Table'[Date],2)=6 || WEEKDAY('Table'[Date],2)=7 || CALCULATE(COUNTROWS(Holiday),FILTER(Holiday,Holiday[start date]<='Table'[Date] && Holiday[end date]>='Table'[Date]))>0 ,0,1 )
Regards,
Based on your description, now you have a holiday reference table which specifies a data range for each holiday. You want to add a isworkingday column in your date diemnsion table. Right?
I assume your Holiday table like below, and you build the relationship between two tables already:
You can apply the condition to check number of records in Holiday table where the current date is within the date range. Please create a calculated column below;
isworkingday = IF(WEEKDAY('Table'[Date],2)=6 || WEEKDAY('Table'[Date],2)=7 || CALCULATE(COUNTROWS(Holiday),FILTER(Holiday,Holiday[start date]<='Table'[Date] && Holiday[end date]>='Table'[Date]))>0 ,0,1 )
Regards,
Thank you very much for the solution , we have used the same DAX what you have mentioned in our trails , but the dotted relationship between date and endate is not created , so we are able get for date related to startdate , we dont aware that we can give relation twice between the same tables.
Thanks for this .
I'm using this syntax to calculate working days. How do I handle null values when either the beginning or ending date is missing.
Production TAT =
SUMX (
FILTER (
'Calendar',
'Calendar'[Date] >= MIN ( 'Order'[date_ProductionScheduled] )
&& 'Calendar'[Date] <= MAX ( 'Order'[date_ProductionDone] )
),
'Calendar'[IsWorkingDay]
)
You should check this community thread:
Got some intersting stuff that can lead you to the final results.
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |