Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Display only the first date for status changes only

I need help with a large table that I have.

I would like to display only the following columns: ID, TAG, Team, Status and Changed Date.

However, I would like to ignore when the TAG changes (and all other changes), except for Status changes and then only get the FIRST DATE when the Status was changed.

See examples below.

BEFORE

IDTAGTeamStatusChanged Date
007GoodTeam ANew01/06/2020
007BadTeam BNew02/06/2020
007NeutralTeam BClosed02/06/2020
007BadTeam BClosed03/06/2020


AFTER

IDTAGTeamStatusChanged Date
007GoodTeam ANew01/06/2020
007NeutralTeam BClosed02/06/2020

 


I appreciate your help in advance
Thanks

6 Replies

  • Anonymous try this measure, in the final output table, use this measure for the date and remove another changed date column

     

    Measure x = 
    VAR __m = CALCULATE ( MIN ( 'Table (4)'[Changed Date] ), ALLEXCEPT ( 'Table (4)', 'Table (4)'[ID],  'Table (4)'[Status] ) )
    RETURN IF ( MAX ( 'Table (4)'[Changed Date] ) == __m, __m )
    

     

    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.

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k  thank you, but I'm geetting an error "The expression specified in the query is not a valid table expression"

      • parry2k's avatar
        parry2k
        Icon for Super User rankSuper User

        Anonymous I believe you changed the table and column name in the measure per your model, correct?