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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
River
Helper IV
Helper IV

dynamic relation between tables based on slicer

Hi Friends,

 

Is there a way to dynamicly creating relation between tables based on slicer?

We have a situation that, depending on filter/slicer, the two tables relation will be based on different field, how can I achieve it.

 

Many thanks,

2 ACCEPTED SOLUTIONS
arvindsingh802
Super User
Super User

You can create inactive relationship and based os slicer slection, calculate your measure using any of the relation with USERELATIONSHIP funtion of DAX.

 

If this post helps, then please consider Accept it as the solution and give it a thumbs up


If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

View solution in original post

V-pazhen-msft
Community Support
Community Support

@River 

You can only have one static relationship between 2 tables, slicer can only work on report page. There is no way to dynamically change relationship in power bi. Other than the userelationship(), you may also use Treatas() and Intersect() function for virtual relationship.

 

USERELATIONSHIP function (DAX) - DAX | Microsoft Docs

Physical and Virtual Relationships in DAX - SQLBI

 

 

Paul Zheng _ Community Support Team

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@River 

You can only have one static relationship between 2 tables, slicer can only work on report page. There is no way to dynamically change relationship in power bi. Other than the userelationship(), you may also use Treatas() and Intersect() function for virtual relationship.

 

USERELATIONSHIP function (DAX) - DAX | Microsoft Docs

Physical and Virtual Relationships in DAX - SQLBI

 

 

Paul Zheng _ Community Support Team

arvindsingh802
Super User
Super User

You can create inactive relationship and based os slicer slection, calculate your measure using any of the relation with USERELATIONSHIP funtion of DAX.

 

If this post helps, then please consider Accept it as the solution and give it a thumbs up


If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors