Forum Discussion
Use relationship total issue
- 9 months ago
Hi TaroGulati,
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used the sample data on my end and successfully implemented it. I am also including .pbix file for your better understanding, please have a look into it:
Hope this will help you resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.For your first question, you can handle multiple inactive relationships more efficiently by creating a calculation group rather than relying on a lengthy SWITCH statement. Since Power BI Desktop doesn’t currently allow you to create calculation groups directly, you’ll need to use Tabular Editor for this task. This method lets you activate the necessary relationship dynamically for each measure, making your DAX code cleaner and easier to manage.
Thank you for using Microsoft Community Forum.
Hi TaroGulati ,
Can you try creating composite keys which can be combination of columns used in relationship and then try to join it.
You can try below dax to create columns in fact and dimensions and then join them using relationships.
ck = Dim[Category Sales] & Dim[Category Finance]&Dim[Category Warehouse]
//create this in DIm tableck = 'Fact'[Category Sales] & 'Fact'[Category Finance]&'Fact'[Category Warehouse] //create this in fact tablejoin them using relationship as shown below.
Fact(CK) 1<----->1 Dim(CK)
relationship cardinality may vary based on your data.
Please give Kudos or mark it as resolved once confirmed.
Thanks and Regards,
Praful Potphode
Hi Praful_Potphode thanks for the feedback but in my case composite key can't work
- v-sgandrathi9 months agoCommunity Support
Hi TaroGulati,
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used the sample data on my end and successfully implemented it. I am also including .pbix file for your better understanding, please have a look into it:
Hope this will help you resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.For your first question, you can handle multiple inactive relationships more efficiently by creating a calculation group rather than relying on a lengthy SWITCH statement. Since Power BI Desktop doesn’t currently allow you to create calculation groups directly, you’ll need to use Tabular Editor for this task. This method lets you activate the necessary relationship dynamically for each measure, making your DAX code cleaner and easier to manage.
Thank you for using Microsoft Community Forum.- v-sgandrathi9 months agoCommunity Support
Hi TaroGulati,
Just wanted to follow up and confirm that everything has been going well on this. Please let me know if there’s anything from our end.
Please feel free to reach out Microsoft fabric community forum.- v-sgandrathi9 months agoCommunity Support
Hi TaroGulati,
Just checking in -- have you had a chance to review and try the provided solution? Kindly share the status whenever you get a chance.
Looking forward to your response.