Forum Discussion

luanamoreschi's avatar
luanamoreschi
Frequent Visitor
4 years ago
Solved

Returning the THIRD date

    Dear All, I need to pull specifically the date of the third order of each customer due to a promotion. What I need is very similar to the formulas FIRSTDATE() and LASTDATE(), ...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    I am not sure how your dataset looks like, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

    I hope the below can provide some ideas on how to create a solution for your dataset.

    I suggest creating a measure for searching the latest date inside TOP3 (ascending) dates.

     

     

    last date of Top three ascending: = 
    IF (
        HASONEVALUE ( Customer[Customer] ),
        MAXX ( TOPN ( 3, Data, Data[Order_Date], ASC ), Data[Order_Date] )
    )