Forum Discussion
Need Help in Dax or column
Actually that I haven't understand the logical of your post completely, do you have a calendar table?
Here is a reference to find the last friday of a month:
I create a calendar table:
Then add a new column:
Column = WEEKDAY('Date'[Date],2)
This returns the weekday of the date:
Finally, I create a measure:
LastFri =
VAR _currentMonth =
MONTH ( MAX ( 'Date'[Date] ) )
VAR _Fri =
FILTER (
ALL ( 'Date' ),
'Date'[Column] = 5
&& MONTH ( 'Date'[Date] ) = _currentMonth
)
RETURN
MAXX ( _Fri, [Date] )
Then you can get the last friday of current week:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Thanks for your response, I'm not expecting this as a result. sorry for that, some how i couldn't explained clearly,
I have multiple tasks and that will run based on the cron_day column, which means that day of the every month
For example, if i select 01-Apr-2024 using my Date slicer,
I want to display the what all are the task will come under the selected date, which means this task will run on the Cron_day which mentioned in the table.
As per the selected date as 01-Apr-2024, the below task should come in the table
Task Name
Task 8
Task 13
Task 10
Task 8 , cron day is 1, selected date Day is 1, so it's coming
Task 13 cron day is 1st mon(monday) , selected date is 01-Apr-2024 and its the 1st monday of the month so it should come
Task 10 Cron day is 1st mon(monday), selected date is 01-Apr-2024 and its the 1st monday of the month so it should come
As above i said for cron_day number value, we can match the day of the selected date with the Cron day field value and we can get the result.
But 1st mon( for now i'm just saying on example) , how can we find this date is the 1st mon of the month , it my differ right on the month.
I hope i clearly explain the requirement