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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Alex_nor
Frequent Visitor

Create a column with ID using date range

Hello all, 

I have those two tables:

Table1

Alex_nor_1-1663936002807.png

 

Table2:

Alex_nor_0-1663935979700.png

 

I would like to create a new column in Table2 where i get the ProductId from Table1 depending on the dates.

Dates between 23-06-2022 and 04-07-2022 in Table1 should have ProductID = 05-07-2022_Ba,

dates between 05-07-2022 and 27-07-2022 in Table1 should have ProductID = 28-07-2022_Ba, and so on.

Do you have any suggestion?

 

Thank you.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1663938865553.png

 

 

Product ID CC =
SUMMARIZE (
    FILTER (
        Table1,
        Table1[Load date]
            = MINX (
                FILTER ( Table1, Table1[Load date] > Table2[TimeStamp] ),
                Table1[Load date]
            )
    ),
    Table1[ProductID]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1663938865553.png

 

 

Product ID CC =
SUMMARIZE (
    FILTER (
        Table1,
        Table1[Load date]
            = MINX (
                FILTER ( Table1, Table1[Load date] > Table2[TimeStamp] ),
                Table1[Load date]
            )
    ),
    Table1[ProductID]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.