Selecting last Thursday in a month

  • Selecting last Thursday in a month

    Posted by DSC Communities on June 17, 2020 at 1:15 pm
    • Krishna Nandan

      Member

      June 17, 2020 at 1:15 PM

      Hi All,
      i have question to select a day in a month.
      I have 12 months data and I want to select only last Thursday of the month by DAX. Is it possible?

      ——————————
      Krishna Nandan
      SME
      Bangalore
      ——————————

    • Lutz Bendlin

      Member

      June 17, 2020 at 1:51 PM

      Define “select”.Ā  Do you want a calculated column in your dates table with that flag, do you want a measure, or do you just want to have a list of months and then the date for that thursday?

      Here’s an example of the latter, based on a calculated column (assuming you have no other filters that could impact that, like “Last thusday of each month that we have transactions for”Ā  etc)

      Last Thursday =
      var mc = Dates[monthcode]
      return calculate(max(Dates2025),WEEKDAY(Dates2025,2)=4,Dates[monthcode]=mc)

      ——————————
      Lutz
      ——————————
      ——————————————-

    • Krishna Nandan

      Member

      June 18, 2020 at 2:11 AM

      Hi Lutz
      Thank you very much for your reply.
      i will give you the context- i have a multi row card and what i have to do is, if i select a month in the slicer multi row card should show two months comparison. For this i wrote a parameter and sync with card calculation measure .Ā 

      Below formula i use for that.
      Dynamic BACKup succ =
      CALCULATE (
      M_Backup_Data_data[Backup Successful %],
      DATESINPERIOD ( ‘Calendar'[DateKey], MAX ( ‘Calendar'[DateKey] ), -Parameter1[Parameter1 Value], MONTH )
      )

      Now the issue is- i have one table where i have to take only last ThursdayĀ data for the month which will be a measure column and i can use the same slicer from that.Ā  Also, i did not understand your code- My DAX is not taking Dates[monthcode] and what is month code here?

      thanks
      krishna

      ——————————
      Krishna Nandan
      SME
      Bangalore
      ——————————
      ——————————————-

    DSC Communities replied 5 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Selecting last Thursday in a month’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!