Forum Discussion
One slicer from two different tables
- 7 years ago
Pri , re-read this post. Not sure but this seems like a use case for the disconnected table trick. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563.
Attached a PBIX with a possible solution. You want the TotalValues, InternalValues and Slicer tables. The measure is:
Measure = VAR __measure = MAX('Slicer'[Column1]) RETURN SWITCH(TRUE(), __measure = "Total Value",SUM('TotalValues'[Total Value]), __measure = "Internal Value",SUM('InternalValues'[InternalValue]), __measure = "External Value",SUM('TotalValues'[Total Value]) - SUM('InternalValues'[InternalValue]), -1 )Critically, this assumes that your two tables are related in some fashion. If not, you will have to use LOOKUPVALUE or something along those lines to relate the Total Value to the Internal Value.
I would suggest creating a calculated column that performs that calculation and returns 0 and 1 or true/false, etc. depending upon the outcome. Then use that column as your slicer.