Forum Discussion
Measure to Identify Values in table when filtered
- 1 year ago
If you just need it for one measure, you could use something like
My Measure = CALCULATE( SUM( 'Table'[Value] ), TREATAS( VALUES( Counter party slicer[counter_party] ), Counterparty_tbl[counter_party] ) )replacing the SUM with whatever calculation you needed.
If you want to apply it to multiple measures you could use a calculation group and create a calculation item like
Calc Item = CALCULATE( SELECTEDMEASURE(), TREATAS( VALUES( Counter party slicer[counter_party] ), Counterparty_tbl[counter_party] ) )and then apply that calc item as a filter on the visuals you want to impact.
There's no way to do this with interactions turned off, as the table / matrix visual in which the measure is executed has no access to the slicer.
You can create a disconnected table to use in the slicer like
Counter party slicer = VALUES( Counterparty_tbl[counter_party] )
Then create a measure like
Identify =
IF (
SELECTEDVALUE ( Counterparty_tbl[counter_party] )
= SELECTEDVALUE ( 'Counter party slicer'[counter_party] ),
1,
0
)
johnt75 Thank you for that. Is there a way that to use a disconnected table but use that table to filter context in the counterparty_tbl? becuase that works but if i create a relationship it then breaks?
- johnt751 year agoSuper User
Not within visuals, but you could make it have an effect in measures by using
TREATAS( VALUES( Counter party slicer[counter_party] ), Counterparty_tbl[counter_party] )- ViralPatel2121 year agoResolver I
johnt75 How can i have that incorporated into my measure and make it work?
- johnt751 year agoSuper User
If you just need it for one measure, you could use something like
My Measure = CALCULATE( SUM( 'Table'[Value] ), TREATAS( VALUES( Counter party slicer[counter_party] ), Counterparty_tbl[counter_party] ) )replacing the SUM with whatever calculation you needed.
If you want to apply it to multiple measures you could use a calculation group and create a calculation item like
Calc Item = CALCULATE( SELECTEDMEASURE(), TREATAS( VALUES( Counter party slicer[counter_party] ), Counterparty_tbl[counter_party] ) )and then apply that calc item as a filter on the visuals you want to impact.