Forum Discussion
Calculate sum using different relationships based on condition
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Hello lbendlin,
I edited the message to include HTML tables. You can also find an example with the expected result.
- lbendlin2 years ago
Super User
I think we're missing the Company table
Not sure where you are going with the is_switched but likely you can use inactive relationships.
- obungianer2 years agoNew Member
The company table is just a simple dimension:
company_id name 1 company 1 2 company 2
The is_switched column indicated whether the active or inactive relationship should be used to calculate the total sum and for which top_name and name to display the value in a visual. Please review my question and examples. It explains the purpose of the is_switched column.
I'm already using inactive and active relationships.- lbendlin2 years ago
Super User
I reviewed your questions and examples and I don't understand the logic. I hope someone else can help you further.