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
udian
Helper III
Helper III

Using inactive relationship for filtering purposes

Hi All,

 

Is there a way to filter a fact tale with an inactive dimesion connection or do i have to duplicate my dimesion table for every connection with the fact table?

 

For example, if my fact table have two connections to the time dimension on registration date and installation date columns and the registration date is my active connection. Can is still filter in installation date?

 

I know that measures can relate to inactive connections using USERELATIONSHIP function and i want to know if there is somthing similar for filtering purposes?

 

Thanks!

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@udian


In DAX, the USERELATIONSHIP() can only be used in CALCULATE() function. In this scenario, you can use CONTAINS() inside of FILTER() to get map columns under inactive relationship. Please refer to my sample below:


I have two tables.


Capture1.PNG

Capture5.PNG


I create two relationships, ID->Number, Name->Name, with only ID->Number active.


Capture56.PNG


To filter the bigger table, I use formula below. 


FILTER(ALL(Table4),CONTAINS(VALUES(Table3),Table3[Name],Table4[Name]))
It will filter tables based on names instead of numbers.


Capture.PNG


Regards,


View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@udian


In DAX, the USERELATIONSHIP() can only be used in CALCULATE() function. In this scenario, you can use CONTAINS() inside of FILTER() to get map columns under inactive relationship. Please refer to my sample below:


I have two tables.


Capture1.PNG

Capture5.PNG


I create two relationships, ID->Number, Name->Name, with only ID->Number active.


Capture56.PNG


To filter the bigger table, I use formula below. 


FILTER(ALL(Table4),CONTAINS(VALUES(Table3),Table3[Name],Table4[Name]))
It will filter tables based on names instead of numbers.


Capture.PNG


Regards,


Thanks for your help!

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.