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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
CornelisV
Advocate II
Advocate II

How to handle time range in the relationship

Dear all,

 

I want to connect 3 tables but suffer from time range from one table, that can only linked with column 'ID'.

 

CornelisV_0-1760451900307.png

 

Table Date is generated from Autocalendar.

Table Range has a Start and End time with corresponding ID.

Table Score has the columns ID and the Score.

Goal is to combine three tables in in a Table view like this:

 

CornelisV_1-1760452057567.png

A relationship between ID is possible, but the relationship between date and date range (start and end) is not possible. I can only choose Start or End dates to build a relationship, but that will result in an incomplete table.

Do you have a smart DAX solution?

 

Best regards,

 

Cornelis

 

 

1 ACCEPTED SOLUTION
MasonMA
Community Champion
Community Champion

Hi, 

 

With DAX, i'd suggest building a Bridge table and have it connected with Score Table. 

Bridge =
VAR _Expanded =
    ADDCOLUMNS (
        GENERATE (
            'Range',
            VAR StartDate = 'Range'[StartDate]
            VAR EndDate = 'Range'[EndDate]
            RETURN
                CALENDAR ( StartDate, EndDate )
        ),
        "DateTable", [Date]
    )
RETURN
    SELECTCOLUMNS ( _Expanded, "Date", [Date], "ID", 'Range'[ID] )
MasonMA_0-1760453753977.png

 

View solution in original post

6 REPLIES 6
CornelisV
Advocate II
Advocate II

Dear @MasonMA ,

 

That is a massive solution, easy to create and avoiding memory use in Power BI. I fully agree with @v-menakakota that this is an interesting topic and a good learning point.

Hi @CornelisV ,

Thank you for the update.

Ashish_Mathur
Super User
Super User

Hi,

In Power Query, you can create another column with each cell showing each date which falls within a range.  This way each row of start and end date will explode into multiple rows.  The you can create a relationship with the Calendar table.  This is broadly how it is done in Power Query

={Number.From(start)..Number.From(End)}


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

Thank you for your support. Yes, with Power Query , you can multiple observation in table "Range". That is more a Query than a DAX solution. Creating multiple rows from a time range has been advised earlier in this forum.

 

Best regards,

 

Cornelis

Hi @CornelisV 
Thanks for reaching out to the Microsoft fabric community forum. 

 

I would also take a moment to thank @MasonMA   , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

I hope the below details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you 

 

 

Best Regards, 
Community Support Team  

MasonMA
Community Champion
Community Champion

Hi, 

 

With DAX, i'd suggest building a Bridge table and have it connected with Score Table. 

Bridge =
VAR _Expanded =
    ADDCOLUMNS (
        GENERATE (
            'Range',
            VAR StartDate = 'Range'[StartDate]
            VAR EndDate = 'Range'[EndDate]
            RETURN
                CALENDAR ( StartDate, EndDate )
        ),
        "DateTable", [Date]
    )
RETURN
    SELECTCOLUMNS ( _Expanded, "Date", [Date], "ID", 'Range'[ID] )
MasonMA_0-1760453753977.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.