Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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,
Solved! Go to Solution.
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
@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
@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
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |