Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 7
Anonymous
Not applicable

Why don't you just remove the duplicates from the table using Power Query?

Best
D
Anonymous
Not applicable

@Anonymous 

 

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

camargos88
Community Champion
Community 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



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



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

@Anonymous 

 

How are you calculation the total for each combination ?

Can you explain your model ?

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Hi @camargos88 ,

 

I currently have the measure of:

 

Total Bookable Hours = CALCULATE(

    COUNT(vwDimDate[Date]),

    FILTER(vwDimDate,vwDimDate[WorkingDayFlag]=1)) * 10

 

This however, doesn't take into consideration that a room could be duplicated for its bookable hours.

Does that make sense?

 

Thanks

 

@Anonymous ,

 

I would try to rank the values using Power Query and test if it's the number 1 to assign the value..

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors