Forum Discussion

Vanditha's avatar
Vanditha
Microsoft Employee
2 years ago
Solved

Urgent !!! Query to Get latest status/value Using Dax/Power query

Hi  Every one . I need help on beow requirement. Package rev needs to be sorted out in  desc. I did this. However main requirement is need to get the latest status based on the PackageRev column.  ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Vanditha ,

     

    Based on your description, I obtained the following results using the sample you provided:

    Latest Rev = var _t1= ADDCOLUMNS('Table',"Test",MAXX(FILTER(ALL('Table'),[ID]=EARLIER([ID])),[PackageRev]))
    var _t2 = ADDCOLUMNS(_t1,"True",IF([Test]=[PackageRev],1,0))
    return CALCULATE(MAXX(FILTER(_t2,[True]=1),[PackageRev]))

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

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