Forum Discussion
Allselect except one slicer
- Anonymous7 years ago
Hi AlB ,
Thank you for your answer. Unfortunately the measure doesn't work. It returns an error saying that multiple value was returned while a single value was expected. However, I do manage to create a measure that works based on your idea:
Measure = VAR _Color = CALCULATE(SELECTEDVALUE(Sales[Color]), Sales[Year] = 2010) RETURN CALCULATE( SUM(Sales[Sales]), ALL(Sales[Product]), Sales[Color] = _Color, Sales[Year] = 2010 )Thank you again for your help! :smileyhappy:
JC
Hi Anonymous
Assuming all fields are on the Sales table, try this measure in a card visual, with the two slicers you show:
Measure =
VAR _Color =
CALCULATE ( DISTINCT ( Sales[Color] ), Sales[Year] = 2010 )
RETURN
CALCULATE (
SUM ( Sales[Sales] ),
FILTER ( ALL ( Sales[Color] ), Sales[Color] = _Color ),
Sales[Year] = 2010,
ALL ( Sales[Product] )
)
If this doesn't work please show a sample of your tables. Always show your sample data in text-tabular format in addition to (or instead of) the screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).
Hi AlB ,
Thank you for your answer. Unfortunately the measure doesn't work. It returns an error saying that multiple value was returned while a single value was expected. However, I do manage to create a measure that works based on your idea:
Measure =
VAR _Color = CALCULATE(SELECTEDVALUE(Sales[Color]), Sales[Year] = 2010)
RETURN
CALCULATE(
SUM(Sales[Sales]),
ALL(Sales[Product]),
Sales[Color] = _Color,
Sales[Year] = 2010
)Thank you again for your help! :smileyhappy:
JC