Forum Discussion
Slicer with Measures - Select Multiple
Here's the sitch, I made a measure to track my credit card and bank account balances. I plot them on a line chart and use a slicer to choose the card/account. PROBLEM: I cannot select multiple cards or accounts. It is either one or all.
Here's the measure I use for the cards/accounts:
Hello @caseysmith6 ,
Depending on your description, you can create this measure:
Balance = VAR _account = SELECTEDVALUE ( 'CC Dimension'[Measure] ) VAR _total = CALCULATE ( SUM ( 'YTD Cash & CC TD'[Paid Amount] ), FILTER ( ALLSELECTED ( Dates[Date] ), 'Dates'[Date] <= MAX ( 'Dates'[Date] ) ) ) VAR account = CALCULATE ( SUM ( 'YTD Cash & CC TD'[Paid Amount] ), FILTER ( ALLSELECTED ( Dates[Date] ), 'Dates'[Date] <= MAX ( 'Dates'[Date] ) ), 'YTD Cash & CC TD'[Account] = _account ) RETURN IF ( NOT ( ISFILTERED ( 'CC Dimension'[Measure] ) ), _total, account )Attached a sample file in the next one, hopes to help you.
Best Looks,
Yingjie LiIf this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
7 Replies
- mahoneypat
Microsoft Employee
The SELECTEDVALUE is the problem. You can try this to get around it. Replace with the actual table and column with your cards in the slicer.
NewMeasure = SUMX(VALUES(Table[CardColumn]), [Apple Card])
There's probably a better way to construct the other measures, but this uses what you have now.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- AnonymousNot applicable
mahoneypat Thanks for the response. Where am I supposed to put this NewMeasure? I can't put it directly into the slicer (as in, it won't let me). The slicer is currently using the Measure column from this index table.
Are you suggesting I abandon the Index table? Since that's where SELECTEDVALUE comes into play.
Thanks!- mahoneypat
Microsoft Employee
Thank you for the additional info. I think I misunderstood your model. Why did you set up a measure slicer instead of a simple category slicer on your Account values?
Did you consider a measure like this and a slicer on your Account column on the page?
Card Balance = CALCULATE(SUM('YTD Cash & CC TD'[Paid Amount]),FILTER(ALLSELECTED(Dates),Dates[Date] <= MAX(Dates[Date]))If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- v-yingjl
Community Support
Hello @caseysmith6 ,
Depending on your description, you can create this measure:
Balance = VAR _account = SELECTEDVALUE ( 'CC Dimension'[Measure] ) VAR _total = CALCULATE ( SUM ( 'YTD Cash & CC TD'[Paid Amount] ), FILTER ( ALLSELECTED ( Dates[Date] ), 'Dates'[Date] <= MAX ( 'Dates'[Date] ) ) ) VAR account = CALCULATE ( SUM ( 'YTD Cash & CC TD'[Paid Amount] ), FILTER ( ALLSELECTED ( Dates[Date] ), 'Dates'[Date] <= MAX ( 'Dates'[Date] ) ), 'YTD Cash & CC TD'[Account] = _account ) RETURN IF ( NOT ( ISFILTERED ( 'CC Dimension'[Measure] ) ), _total, account )Attached a sample file in the next one, hopes to help you.
Best Looks,
Yingjie LiIf this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
- AnonymousNot applicable