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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Daniel_Rocha14
Regular Visitor

Create a Collum Based on another Table

I have two tables:
Table 1 have a collunm production-date.
       

DATEPRODUCTION

PRODUCTION

2023-06-12

3

2
In Table 2, i have 3 collunms, the first collum is the round, the second collunm is the round start date, and the third is the round finish date.

ROUNDSTART_DATEEND_DATE
22023/06/122023/06/28
32023/06/292023/07/12



I want to create a collunm in the Table 1, that have the round  where that event occurs. 

       

DATEPRODUCTION

PRODUCTIONROUND

2023-06-12

32



How to compare these date columns and understand that something happened between the start date and the end date, and return the round number where this event occurred?/

1 ACCEPTED SOLUTION
Adescrit
Impactful Individual
Impactful Individual

Hi @Daniel_Rocha14 

Please try the following DAX in a new column in table 1

ROUND = 
VAR __DATE = Table1[DATEPRODUCTION]
RETURN
    CALCULATE( MIN( Table2[ROUND] ),
        __DATE >= Table2[START_DATE] &&
            __DATE <= Table2[END_DATE]
    )

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

View solution in original post

2 REPLIES 2
Adescrit
Impactful Individual
Impactful Individual

Hi @Daniel_Rocha14 

Please try the following DAX in a new column in table 1

ROUND = 
VAR __DATE = Table1[DATEPRODUCTION]
RETURN
    CALCULATE( MIN( Table2[ROUND] ),
        __DATE >= Table2[START_DATE] &&
            __DATE <= Table2[END_DATE]
    )

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

it work exactly like i wanted, thank you a lot!!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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