Forum Discussion
Dynamic multiple slicers
- 6 years ago
Hi Anonymous ,
Create a table with both tables you need:
Type Value
Product Sports Product Sleep Vendor AAAAA Vendor BBBBB Now do the following measure:
Sum Sales = VAR SelectedType = SELECTEDVALUES ( Slicer[Type] ) VAR Selected_Value = VALUES ( Slicer[Value] ) RETURN SWITCH ( SelectedType ; "Vendor"; CALCULATE ( SUM ( Sales[QUANTITY(€) ] ); Vendors[VENDOR_ID ] IN Selected_Value); CALCULATE ( SUM ( Sales[QUANTITY(€) ] ); Products[CATEGORY ] IN Selected_Value) )Now use the measure as your values on the charts as you can see in attach file altough I am selecting on products and vendor one of the visualizations is made on subcategory.
Anonymous - See if this helps: https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-EVERYTHING-measures-axis-legend-titles-chart-types/m-p/1027881#M444
- Anonymous6 years agoNot applicable
Thanks for your answer, the link is great, but it's only working with one table and applying filters to it. In my case, I have multiple tables, and PowerBI should show info from one table or other.
- Greg_Deckler6 years agoCommunity Champion
Anonymous - One thought on this, use buttons instead of slicers for your "vision". Then you could leverage stacked visuals and bookmarks.
- MFelix6 years agoSuper User
Hi Anonymous ,
Create a table with both tables you need:
Type Value
Product Sports Product Sleep Vendor AAAAA Vendor BBBBB Now do the following measure:
Sum Sales = VAR SelectedType = SELECTEDVALUES ( Slicer[Type] ) VAR Selected_Value = VALUES ( Slicer[Value] ) RETURN SWITCH ( SelectedType ; "Vendor"; CALCULATE ( SUM ( Sales[QUANTITY(€) ] ); Vendors[VENDOR_ID ] IN Selected_Value); CALCULATE ( SUM ( Sales[QUANTITY(€) ] ); Products[CATEGORY ] IN Selected_Value) )Now use the measure as your values on the charts as you can see in attach file altough I am selecting on products and vendor one of the visualizations is made on subcategory.