Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Check if row contains the same value

Hi,

 

Is there a way in Power BI/Dax to check if a row has matching values in two columns (Room & Building Name), and if it does and the total has already been worked out once for that room and building (1280). then enter 0 like in my example below?

 

RoomBuilding NameHours available (No Duplicates)
Classroom 1Building 11280
Classroom 2Building 21280
Classroom 2Building 20
Classroom 2Building 20
Classroom 4Building 41280
Classroom 4Building 40

7 Replies

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

    Hi Anonymous ,

     

    Is it possible to have a table without duplicated data and 1 column to identify the qtd os duplicated ?

    So you can avoid it.

     

    Ricardo

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi camargos88 ,

       

      Unfortunately, its bookings data so the room and building will always have duplications as theres multiple bookings for that room.

       

      Thanks

       

      Liam

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

        Anonymous 

         

        How are you calculation the total for each combination ?

        Can you explain your model ?

         

        Ricardo

  • Anonymous's avatar
    Anonymous
    Not applicable
    Why don't you just remove the duplicates from the table using Power Query?

    Best
    D
    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous 

       

      Each row is a booking, so I couldnt just remove unfortunately