Forum Discussion

Leon_DP's avatar
Leon_DP
New Member
2 years ago

PowerBi Dax

Hi community

 

I am fairly new to DAX language. How do I write a query in a new column that will flag the highest sequence number as the latest of a group unique Parent ID's?

 

 

Thanks

1 Reply

  • ValtteriN's avatar
    ValtteriN
    Icon for Community Champion rankCommunity Champion

    Hi,

    Here is one way to do this:

     

    Dax:

    Flag if latest =
    var _id = [ID]
    var _l = CALCULATE(MAX('Table (2)'[Sequence]),FILTER(ALL('Table (2)'[Sequence]),[ID]=_id))
    return
    IF('Table (2)'[Sequence]=_l,"Latest",BLANK())

    End result:

     

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/