Forum Discussion
Filter table based on values from other table
Then you will have to use TREATAS for example in my model I broke the relationship between products and sales but using TREATAS i can create a virtual relationship:
Total Sales TREATAS =
CALCULATE (
[Total Sales],
TREATAS ( VALUES ( Products[ProductKey] ), Sales[ProductKey] )
)Rank =
IF (
HASONEVALUE ( Products[Brand] ),
RANKX ( ALL ( Products[Brand] ), [Total Sales TREATAS] )
)
Thanks AntrikshSharma. Based on your description, this is exactly what I am after. However, I am struggling to get it to work, because my equivalent of your Products table is filtered by a slicer and does only return one value right now. Any suggestion on how I can fix that?
- AntrikshSharma6 years agoCommunity Champion
Like this?
Rank = IF ( HASONEVALUE ( Products[Brand] ), RANKX ( ALLSELECTED ( Products[Brand] ), [Total Sales TREATAS] ) )- Anonymous6 years agoNot applicable
No, all product brands should be included regardless of what is selected on the slicer. Thanks so much for your patience AntrikshSharma
- AntrikshSharma6 years agoCommunity Champion
I think you do not want the slicer to impact the visual, right? In that case you should use the Edit Interactions option. Select the slicer and then click the icon on visual that looks like the top view of a screw.