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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Ralf123
Frequent Visitor

Create column by comparing dates from different tables

Hello,

 

I want to add a column from another table after checking if a certain date falls between 2 dates from other columns.

 

I have 2 tables, Tables S/N used by

and

Table transactions (see both below).

 

I want to create a column 'ID nr.' in the transactions table (in red) and that ID nr. I get from 'Table S/N used by' after I checked if the date in the 'transactions table' falls between the 2 dates in 'Table S/N Used by'.

 

Table S/N used by   
idS/NUsed by ID nr.fromto
112345613-2-201714-2-2017
212378915-2-20716-2-2017
     

 

Table transactions    
idamountdateS/N ID nr.
11013-2-2018123 456
22014-2-2018123 456
32515-2-2018123 789
43016-2-2018123 789

 

Hopefully it is clear what I mean.

 

Thanks,

 

Ralf

2 ACCEPTED SOLUTIONS

Great. This was very helpful. Thanks

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Great. This was very helpful. Thanks

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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