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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Help with date referencing between two different tables

Hello,

I have a complicated ask that I was hoping to get some assistance on:

There are two tables, a Initiation Event table, and a Schedule table that I am using. Using the initiation event table, I need to take use the Effective Date to lookup against the Schedule table to determine which schedule Group to lookup and then the row record to lookup against, then once that is determined, use the Completed Date from the Initiation Event table, to determine if it is before or after a Locked Date column

 

Below is a link a sample PBIX file, along with a screenshot of the desired outcome. One of the schedule Groups does not have a Period Number, and will lookup against a different column than the other groups (see pbix for more information)

 

PBIX file = click here

 

Desired Outcome:

Outcome.jpg

 

 

Any direction would be very helpful.

 

Thanks,

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

Try these calculated columns in table Initiation Event:

 

Period Number = 
VAR vGroup = 'Initiation Event'[Group]
VAR vEffDate = 'Initiation Event'[Effective Date]
VAR vTable =
    FILTER (
        Schedule,
        Schedule[Group] = vGroup
            && vEffDate >= Schedule[Period Start Date]
            && vEffDate <= Schedule[Period End Date]
    )
VAR vResult =
    IF ( NOT 'Initiation Event'[Group] = "D1", MAXX ( vTable, Schedule[Period Number] ) )
RETURN
    vResult
Period = 
VAR vGroup = 'Initiation Event'[Group]
VAR vEffDate = 'Initiation Event'[Effective Date]
VAR vTable =
    FILTER (
        Schedule,
        Schedule[Group] = vGroup
            && vEffDate >= Schedule[Period Start Date]
            && vEffDate <= Schedule[Period End Date]
    )
VAR vResult =
    MAXX ( vTable, Schedule[Period] )
RETURN
    vResult
Locked Date = 
VAR vGroup = 'Initiation Event'[Group]
VAR vPeriodNumber = 'Initiation Event'[Period Number]
VAR vPeriod = 'Initiation Event'[Period]
VAR vResult =
    SWITCH (
        vGroup,
        "D1",
            VAR vTableD1 =
                FILTER ( Schedule, Schedule[Group] = vGroup && Schedule[Period] = vPeriod )
            VAR vLockedDateD1 =
                MAXX ( vTableD1, Schedule[Locked Date] )
            RETURN
                vLockedDateD1,
        VAR vTableOther =
            FILTER (
                Schedule,
                Schedule[Group] = vGroup && Schedule[Period Number] = vPeriodNumber
            )
        VAR vLockedDateOther =
            MAXX ( vTableOther, Schedule[Locked Date] )
        RETURN
            vLockedDateOther
    )
RETURN
    vResult
Completed Before Locked Date = 
IF ( 'Initiation Event'[Completed Date] < 'Initiation Event'[Locked Date], "Yes", "No" )

 

DataInsights_0-1661983034243.png

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Does @DataInsights  's  method help you? If so, please mark his answer as a soultion to close the case. If not, please provide more details with your desired output.

 

How to Get Your Question Answered Quickly 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

DataInsights
Super User
Super User

@Anonymous,

 

Try these calculated columns in table Initiation Event:

 

Period Number = 
VAR vGroup = 'Initiation Event'[Group]
VAR vEffDate = 'Initiation Event'[Effective Date]
VAR vTable =
    FILTER (
        Schedule,
        Schedule[Group] = vGroup
            && vEffDate >= Schedule[Period Start Date]
            && vEffDate <= Schedule[Period End Date]
    )
VAR vResult =
    IF ( NOT 'Initiation Event'[Group] = "D1", MAXX ( vTable, Schedule[Period Number] ) )
RETURN
    vResult
Period = 
VAR vGroup = 'Initiation Event'[Group]
VAR vEffDate = 'Initiation Event'[Effective Date]
VAR vTable =
    FILTER (
        Schedule,
        Schedule[Group] = vGroup
            && vEffDate >= Schedule[Period Start Date]
            && vEffDate <= Schedule[Period End Date]
    )
VAR vResult =
    MAXX ( vTable, Schedule[Period] )
RETURN
    vResult
Locked Date = 
VAR vGroup = 'Initiation Event'[Group]
VAR vPeriodNumber = 'Initiation Event'[Period Number]
VAR vPeriod = 'Initiation Event'[Period]
VAR vResult =
    SWITCH (
        vGroup,
        "D1",
            VAR vTableD1 =
                FILTER ( Schedule, Schedule[Group] = vGroup && Schedule[Period] = vPeriod )
            VAR vLockedDateD1 =
                MAXX ( vTableD1, Schedule[Locked Date] )
            RETURN
                vLockedDateD1,
        VAR vTableOther =
            FILTER (
                Schedule,
                Schedule[Group] = vGroup && Schedule[Period Number] = vPeriodNumber
            )
        VAR vLockedDateOther =
            MAXX ( vTableOther, Schedule[Locked Date] )
        RETURN
            vLockedDateOther
    )
RETURN
    vResult
Completed Before Locked Date = 
IF ( 'Initiation Event'[Completed Date] < 'Initiation Event'[Locked Date], "Yes", "No" )

 

DataInsights_0-1661983034243.png

 





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

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors