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.
Hello,
I have a table with all the dates of the year and I would like to fill in a column indicating if the day is a holiday.
To do so, I could not directly download a calendar, however I have a table containing one line per holiday with two columns indicating the start and end date of this holiday (we sometimes make a bridge when the holiday is a Thursday for example).
With this last table, I would need to fill the column of the date table, indicating if the day is a public holiday (with a '0') or a working day ('1').
I had already posted a post with a similar problem but this time I really need to fill this column.
Here is what the table with all the dates looks like (there are already '1' for working days and '0' if is a week-end day :
And here is table with the holidays (there are some duplicates, but it will be filter anyway)
Hope you can help me 🙂
Thank you !
Benjamin
Solved! Go to Solution.
@Ben-Jy , Try a new column like
new column =
var _new =if(countx(filter(holiday, date[date]>=holiday[start] && date[date]>=holiday[end] ),holiday[start])+0>0,0,1)
return
if([work day] =0 || _new =0 ,0,1)
[work day] is column where you have 1 for work day and 0 for weekend
@Ben-Jy , Try a new column like
new column =
var _new =if(countx(filter(holiday, date[date]>=holiday[start] && date[date]>=holiday[end] ),holiday[start])+0>0,0,1)
return
if([work day] =0 || _new =0 ,0,1)
[work day] is column where you have 1 for work day and 0 for weekend
@amitchandak perfect, it works. I understand now the formula and how it works, it will help me for further calculation.
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |