Forum Discussion

ABR002's avatar
ABR002
Helper I
5 years ago
Solved

Finding Latest Fiscal Date in Column

Hi, so what I need to do is I need to have a card that displays the latest fiscal date in a column. My companies Fiscal Year runs from Jul-Jun:

Calendar DateFiscal Month NoFiscal Year
7/1/202112022
8/1/202122022
9/1/202132022
10/1/202142022
11/1/202152022
12/1/202162022
1/1/202272022
2/1/202282022
3/1/202292022
4/1/2022102022
5/1/2022112022
6/1/2022122022

 

I have a file that shows expenses based on a date, but what I need to somehow extract the date (in a MMMM YYYY format) of the latest one and put it on a card to show "numbers as of" which would be the last date. The problem is that when I use a max function, it automatically goes to December, as it thinks that December 2022 is after January 2022.

Here's an example of my data:

DateExpenseFiscal YearFiscal monthConcatNeed
7/4/2021$45202211/2022Jul-22
12/4/2021$44202266/2022Dec-22
1/4/2022$16202277/2022Jan-22
1/6/2022$11202277/2022Jan-22
2/6/2022$10202288/2022Feb-22
4/5/2022$3320221010/2022Apr-22

And the desired result would be to extract from need and get "April 2022". It just seems like everything I try has a side effect.

  • Anonymous's avatar
    Anonymous
    5 years ago

    ABR002 What have you tried?  What are the side effects?

    From my testing, it seems like you could just use MAX(Table[Date]) and set the format string on the measure to MMMM YYYY.

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    ABR002 What have you tried?  What are the side effects?

    From my testing, it seems like you could just use MAX(Table[Date]) and set the format string on the measure to MMMM YYYY.

     

    • ABR002's avatar
      ABR002
      Helper I

      For some reason it always gives me December 2021 when I do that. I can't figure out why. The latest date is July 2021, but it gets more complicated (then I originally mentioned) as the months aren't calendar months, so April 1 might actually be in March.

      What I ended up doing is creating a conditional column that sends the fiscal years date back a year if the month is less than or equal to 6, combine the year and month, and then filter that by max.