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 a Calendar Table in PBI that I need to add a field for Last Working Day of each month. I know for each date if it is a working day, holiday or weekend, but I need identify when the last day of the month falls on a weekend or holiday and roll transaction from those days back to the last working day to summarize several reports correctly.
My goal is to add a calculated column that would filter/group by "Year", "Month" & "IsWorkDay" and return the max date, so for each month I would then know the last working day. How can I do this? I tried the following, but it doesn't provide a unique date for each month, only the max date for the entire calendar:
Solved! Go to Solution.
@kitpalmer
New column to show the last working day
Last Working Day =
VAR __YEAR = 'Calendar Table'[Year]
VAR __MONTH = 'Calendar Table'[Month]
RETURN
MAXX(
FILTER(
'Calendar Table',
'Calendar Table'[Year] = __YEAR && 'Calendar Table'[Month] = __MONTH && 'Calendar Table'[IsWorkDay] = TRUE()
),
'Calendar Table'[Date]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@kitpalmer
New column to show the last working day
Last Working Day =
VAR __YEAR = 'Calendar Table'[Year]
VAR __MONTH = 'Calendar Table'[Month]
RETURN
MAXX(
FILTER(
'Calendar Table',
'Calendar Table'[Year] = __YEAR && 'Calendar Table'[Month] = __MONTH && 'Calendar Table'[IsWorkDay] = TRUE()
),
'Calendar Table'[Date]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Perfect! Thanks for your help.
kp
@kitpalmer
You are welcome !
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |