Forum Discussion

NutNick1982's avatar
NutNick1982
Helper I
6 years ago
Solved

Marking first instance for multiple items

Hi PowerBI Community!

I have a question that hopefully someone can help me out with. I need to mark the first instance  when a “job” goes to 100% complete. There are multiple jobs in the dataset and each one needs to be marked only on the first instance that it reaches 100% complete.

Example of the current dataset looks like this:

Basically I need another column with the marks the first instance only of a job reaching 100%:

Thank you in advance!

  • parry2k's avatar
    parry2k
    6 years ago

    NutNick1982 solution attached

     

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

5 Replies

  • NutNick1982 add a new meaure like this

     

    First Reached to 100% = 
    VAR __date = CALCULATE ( MIN ( Table[Date] ), ALLEXCEPT ( Table, Table[JobId] ), Table[PerentComplete] = 1 )
    RETURN
    IF ( __date = CALCULATE ( MIN ( Table[Date] ), ALLEXCEPT ( Table, Table[JobId] ), Table[PerentComplete] = 1 ), "Yes" ) 

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

    • NutNick1982's avatar
      NutNick1982
      Helper I

      Thank you for your reply. I'm getting "Yes" for all results.

      Results in my Table:

      Measure that I input:

    • parry2k's avatar
      parry2k
      Super User

      NutNick1982 seems like I missed something, will try to reproduce at my end or if you can send pbix with sample data, it will be very helpful.

      • NutNick1982's avatar
        NutNick1982
        Helper I

        It doesn't allow me to share the file on the forum..... the sample data i used to test your measure is below:

         

         DateJob IDPercent Complete

        5/31/20191A90%
        5/31/20192B80%
        6/30/20191A95%
        6/30/20192B85%
        7/31/20191A99%
        7/31/20192B90%
        8/31/20191A100%
        8/31/20192B95%
        9/30/20191A100%
        9/30/20192B99%
        10/31/20191A100%
        10/31/20192B100%
        11/30/20191A100%
        11/30/20192B100%
        12/31/20191A100%
        12/31/20192B100%