Forum Discussion

elouizi's avatar
elouizi
Icon for Helper II rankHelper II
6 years ago
Solved

Previous duration record

Hi,   I am new to Power BI. I want to calculate the previous duration record of a project. I have being trying with Earlier function. But that did not work for me. Please dont use previousYear-fucn...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    6 years ago

    Hi,

    This calculated column works fine

    =LOOKUPVALUE('Duration'[Duration],'Duration'[Date],CALCULATE(MAX('Duration'[Date]),FILTER('Duration','Duration'[Brand]=EARLIER('Duration'[Brand])&&'Duration'[Date]<EARLIER('Duration'[Date]))),'Duration'[Brand],'Duration'[Brand])

    Hope this helps.