Forum Discussion

dexsonc's avatar
dexsonc
New Member
2 years ago
Solved

Finding a value for a calculation

Hello, I have the following case, I need to search for the previous date and meter according to several criteria to calculate Oil hours. *Asset ID *Component *Fluid change (find and use the date ...
  • ryan_mayu's avatar
    2 years ago

    dexsonc 

    you can try this

    date last = maxx(FILTER('Table','Table'[Asset ID]=EARLIER('Table'[Asset ID])&&'Table'[Sample date]<EARLIER('Table'[Sample date])&&'Table'[FLUID_changed]="Y"),'Table'[Sample date])
    
    
    meter last = maxx(FILTER('Table','Table'[Asset ID]=EARLIER('Table'[Asset ID])&&'Table'[Sample date]=EARLIER('Table'[date last])),'Table'[METER])