Forum Discussion

AD_SNOW's avatar
AD_SNOW
Icon for Helper I rankHelper I
2 years ago
Solved

Find the first latest date and second latest date based on quarter selection dynamically

Team, I have a date (which doesn't have continues dates) and quarter fields in my table (mentioned below). My quarter will go as slicer/filter and I want to find the first latest date and the second...
  • Ritaf1983's avatar
    2 years ago

    Hi AD_SNOW 
    To get the desired result you can apply an index of every date according to the quarter from PQ . 

    The guide of how to get this is here :

    https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query

    (Row Number By Group)

    I also attached a pbix ,  you can follow my steps

    From the moment that you have an index this is easy, you can create a simple dax measure for the flag :

    Flag = if(max('Table'[Index]) in {1,2}, MAX('Table'[Index]), " " )

     

    as I mentioned Pbix is attached 🙂

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.