Forum Discussion
Sum 2 filtered visuals (not using relationship)
- 1 year ago
Hi DHorsley1 ,
Thanks for clarifying! If you want the filtering to be dynamic and based on slicer selection (so that you don’t have to manually change the person in the DAX), you can use the SELECTEDVALUE function in your measures. Here’s how you can adapt the measures for dynamic selection:
daxAdjBook_Table1 = CALCULATE( SUM('YourTable'[adj. book of business]), 'YourTable'[Billing Partner] = SELECTEDVALUE('YourSlicerTable'[Person]), 'YourTable'[MMA] <> SELECTEDVALUE('YourSlicerTable'[Person]) ) AdjBook_Table2 = CALCULATE( SUM('YourTable'[adj. book of business]), 'YourTable'[MMA] = SELECTEDVALUE('YourSlicerTable'[Person]), 'YourTable'[Billing Partner] <> SELECTEDVALUE('YourSlicerTable'[Person]) ) CombinedAdjBook = [AdjBook_Table1] + [AdjBook_Table2]
- Replace 'YourSlicerTable'[Person] with the actual table and column you are using for the slicer.
- Place your slicer visual on the report page, so the user can select the person, and the card visual with [CombinedAdjBook] will update automatically based on the slicer selection.
If you have a more complex scenario or run into issues with slicer setup, just let me know your table/column names and I can help tailor the DAX further.
translation and formatting supported by AI - 1 year ago
Hi DHorsley1 ,
Thanks for posting in Microsoft Fabric Community.
To combine the 'adj. book of business' values from the two filtered visuals into a single card, creating a separate measure that replicates your filter logic is the right approach, especially since both visuals are filtered independently and not through a relationship.
Based on the ongoing discussion, your setup involves filtering:
One visual where Billing Partner = selected person and MMA ≠ selected person
Another where MMA = selected person and Billing Partner ≠ selected person
Since the person is selected manually using a slicer, the measure can use SELECTEDVALUE to capture that selection and apply the above conditions inside CALCULATE.
To help write the exact DAX, please share some sample data without sensitive info, including the relevant columns.
Please let us know if the earlier suggestion from burakkaragoz worked for you or if you need further assistance.
Hope this helps. Please reach out for further assistance.
Please consider marking the helpful reply as Accepted Solution and giving kudos to assist others with similar issues.
Thnak you.
Also thanks to burakkaragoz for your continued guidance on this thread
Based on your setup:
- In the first table, you filter for a specific name in Billing Partner and everyone except that name in MMA.
- In the second table, you filter for a specific name in MMA and everyone except that name in Billing Partner.
- You want to combine the sum of 'adj. book of business' from both setups into a single card visual.
You can achieve this with two separate measures for each scenario, then sum them up in a final measure. Here’s an example DAX you can adapt:
AdjBook_Table1 = CALCULATE( SUM('YourTable'[adj. book of business]), 'YourTable'[Billing Partner] = "TargetName", 'YourTable'[MMA] <> "TargetName" ) AdjBook_Table2 = CALCULATE( SUM('YourTable'[adj. book of business]), 'YourTable'[MMA] = "TargetName", 'YourTable'[Billing Partner] <> "TargetName" ) CombinedAdjBook = [AdjBook_Table1] + [AdjBook_Table2]
- Replace "TargetName" with the actual name you are filtering for.
- Change 'YourTable' and [adj. book of business] to match your actual table and column names.
Then, use the [CombinedAdjBook] measure in your card visual to get the combined sum.
Let me know if you need further tweaks or if your filtering logic is more dynamic (for example, based on slicer selection). I can help adjust the DAX accordingly.
Hi Burak,
It would be based on the slicer selection. I have to manually change the person im filtering for each time.
Thanks
- burakkaragoz1 year agoSuper User
Hi DHorsley1 ,
Thanks for clarifying! If you want the filtering to be dynamic and based on slicer selection (so that you don’t have to manually change the person in the DAX), you can use the SELECTEDVALUE function in your measures. Here’s how you can adapt the measures for dynamic selection:
daxAdjBook_Table1 = CALCULATE( SUM('YourTable'[adj. book of business]), 'YourTable'[Billing Partner] = SELECTEDVALUE('YourSlicerTable'[Person]), 'YourTable'[MMA] <> SELECTEDVALUE('YourSlicerTable'[Person]) ) AdjBook_Table2 = CALCULATE( SUM('YourTable'[adj. book of business]), 'YourTable'[MMA] = SELECTEDVALUE('YourSlicerTable'[Person]), 'YourTable'[Billing Partner] <> SELECTEDVALUE('YourSlicerTable'[Person]) ) CombinedAdjBook = [AdjBook_Table1] + [AdjBook_Table2]
- Replace 'YourSlicerTable'[Person] with the actual table and column you are using for the slicer.
- Place your slicer visual on the report page, so the user can select the person, and the card visual with [CombinedAdjBook] will update automatically based on the slicer selection.
If you have a more complex scenario or run into issues with slicer setup, just let me know your table/column names and I can help tailor the DAX further.
translation and formatting supported by AI