Forum Discussion
Red217
5 years agoHelper III
Using a slicer to select multiple values
Hello, i have been using Slicers with SELECTEDVALUE and SWITCH to select different measurements based on the slicer selection, works great BUT, can only make it work for 1 selection. in my cas ...
- 5 years ago
=SUMX(VALUES(Slicer[Value]),SWITCH(Slicer[Value],1,[Measure1],2,[Measure2],3,[Measure3],0))
wdx223_Daniel
5 years agoCommunity Champion
=SUMX(VALUES(Slicer[Value]),SWITCH(Slicer[Value],1,[Measure1],2,[Measure2],3,[Measure3],0))
Red217
5 years agoHelper III
Small follow up, if i have no selection, I cant get it to show "0", I want a case in which if I didn't select anything it will show a zero but currently its showing the sum of all the measures.
this is my formula ( as you written) , what am doing wrong ? :
_DevTestSlicerSum = SUMX( VALUES('Dev Slicer'[Column1]), SWITCH('Dev Slicer'[Column1], "Select1",sum('Table1'[Column1.test1]), "Select2",sum('Table1'[Column1.test2]), "Select3",sum('Table1'[Column1.test3]), "Select4",sum('Table1'[Column1.test4]),0))