Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Dax Required to return 1st Tuesday and 3rd Tuesday of a particular Month from a column(Date opened)

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.

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

You want the Date of the 1st Tuesday and 3rd Tuesday? You could do this:

First Tuesday =
MINX(FILTER('Calendar',WEEKDAY([Date],1) = 3),[Date])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Greg_Deckler
Community Champion
Community Champion

Here is Third Tuesday:

Third Tuesday =
VAR __Table =
ADDCOLUMNS(
FILTER('Calendar',WEEKDAY([Date],1) = 3),
"Order",COUNTROWS(FILTER('Calendar',WEEKDAY([Date],1) = 3 && 'Calendar'[Date] <= EARLIER('Calendar'[Date])))
)
RETURN
MAXX(FILTER(__Table,[Order]=3),[Date])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

9 REPLIES 9
Greg_Deckler
Community Champion
Community Champion

Here is Third Tuesday:

Third Tuesday =
VAR __Table =
ADDCOLUMNS(
FILTER('Calendar',WEEKDAY([Date],1) = 3),
"Order",COUNTROWS(FILTER('Calendar',WEEKDAY([Date],1) = 3 && 'Calendar'[Date] <= EARLIER('Calendar'[Date])))
)
RETURN
MAXX(FILTER(__Table,[Order]=3),[Date])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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])

@Anonymous  - 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?

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

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.

 

Capture.JPG

 

Regards.

 

 
Greg_Deckler
Community Champion
Community Champion

You want the Date of the 1st Tuesday and 3rd Tuesday? You could do this:

First Tuesday =
MINX(FILTER('Calendar',WEEKDAY([Date],1) = 3),[Date])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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]

)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.