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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
dymetre973
Frequent Visitor

Comparing 2 data tables

I have 2 tables containing airline data with airline code, arrival & departure code and arrival time & departure time 

 

Im trying to create a table that compares the 2 tables below and shows me if 2 airlines have departure times from the same arrival airport code that are less than 1 hour apart.

 

Any help ?

 

dymetre973_0-1660592655008.png

 

3 REPLIES 3
dymetre973
Frequent Visitor

The data for these 2 tables is populated from the same source. I just edited the interations so that allow them to be operate seperately.  Can a bridge table still solve this if they are both pulling from 1 table ? 

@dymetre973 

That means they have different filtets. No need in this case to a bridge table we just need first to carefully understand the filter context of each one in order to replicate it using dax code. 

tamerj1
Community Champion
Community Champion

Hi @dymetre973 

you may start with creating a bridge table that contains all the unique Airport Codes and filters both tables. Then you slice by the Airport Code from the bridge table and use the following measure 

Count =
SUMX (
    Table1,
    SUMX (
        Table2,
        IF (
            ABS ( DATEDIFF ( Table1[Departure Time], Table2[Departure Time], MINUTE ) ) < 60,
            1
        )
    )
)

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors