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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jlutz
New Member

How to display related records between table X and Calendar table if relationship is INACTIVE?

I have a single Calendar table with multiple other tables related to it by date.  All of the relationships are "inactive" to avoid circular references et cetera.  For my measures, it's easy enough to use USERELATIONSHIP to specify which relationship to use.

 

However, I have a Table visual, and I want to display all of the records related (via one of the inactive relationships) between table X and my Calendar table.  

 

How can I do this?   

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

@jlutz

 

To achieve your requirement, you can refer to following method:

 

1. Create measures to get the Max and Min date of Calendar table with expression like:

 

StartDate =
CALCULATE ( MIN ( 'Calendar Table'[Date] ), ALLSELECTED ( 'Calendar Table' ) )

2. Create a measure in your source table to filter the records:

 

Flag =
IF (
    MAX ( Table3[Date] ) >= [StartDate]
        && MAX ( Table3[Date] ) <= [EndDate],
    1,
    BLANK ()
)

1.PNG

 

Thanks,
Xi Jin.

View solution in original post

1 REPLY 1
v-xjiin-msft
Solution Sage
Solution Sage

@jlutz

 

To achieve your requirement, you can refer to following method:

 

1. Create measures to get the Max and Min date of Calendar table with expression like:

 

StartDate =
CALCULATE ( MIN ( 'Calendar Table'[Date] ), ALLSELECTED ( 'Calendar Table' ) )

2. Create a measure in your source table to filter the records:

 

Flag =
IF (
    MAX ( Table3[Date] ) >= [StartDate]
        && MAX ( Table3[Date] ) <= [EndDate],
    1,
    BLANK ()
)

1.PNG

 

Thanks,
Xi Jin.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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