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.
Dax Required to return 1st Tuesday and 3rd Tuesday of a particular Month from a column (Date opened) which contains date in the format like 01.Jan.2020.
Also, i had Split Month Name, Day, Day Name from the above column to all separate columns but after this not able to return 1st Tuesday and 3rd Tuesday of a particular Month.
Please help.
Solved! Go to Solution.
1st and Third tuesday shall i create as Measure or new Column?
I created measures. Probably could be adapted for a column if you got rid of aggregations around certain column references.
Third Tuesday is not working as i checked with Measures and used a slicer as visualization:
3rd Tuesday =
VAR __Table =
ADDCOLUMNS(FILTER('New FR 2020',WEEKDAY([Date opened].[Date],1) = 3),
"Order",COUNTROWS(FILTER('New FR 2020',WEEKDAY([Date opened].[Date],1) = 3 && 'New FR 2020'[Date opened].[Date] <= EARLIER('New FR 2020'[Date opened].[Date]))))
RETURN
MAXX(FILTER(__Table,[Order]=3),[Date opened].[Date])
@Sourav_86_Babai - Going to have to let me know what is going on in more detail. I based my calculations on having a date table. See attached PBIX file. Is that what you are using as well or are you using some table that has date holes in it?
Hi,
Thank you for your reply.
I guess something is missing out.
As per your file:
Date = Opened Date
Calender = New FR 2020
I tried to make changes but it is not working.
Regards.
Thanks @Greg_Deckler, your measure formula works well . Do you know if there is a way to mark a date asthe first tuesday of the month, within the Calendar table definition? I.e. Without having to create a separate measure?
@Anonymous - So as a column you would need something like:
First Tuesday Column =
MINX(
FILTER(
'Calendar',
WEEKDAY([Date],1) = 3 &&
YEAR([Date])=YEAR(EARLIER([Date])) &&
MONTH([Date])=MONTH(EARLIER([Date]))
),
[Date]
)
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 | |
68 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |