Forum Discussion
How to loop into All Selected values and apply diffferent logics for different values selected !
Hi All,
I have franchise filter on the page. I am showing this information in a line chart which is plotted for Month and Weeks.
What i want is when franchise is OTHER or NON_COE Other or Contingency, I want to show var u calculation. When other gets selected than I want to show var w calculation.
The problem comes when multiple selection happenes on this franchise filter. When nothing selected that also causes issue.
I have tried below approach when i tried with IN and counting each franchise based calculation in each variables. But that not worked for me.
Another work around, I tried with SWITCH as below and it is working well when I restrict user to select only one value, that is single select in filter.
Is there a way, based on selected values in a slicer I do calculation differently for different selected value like for Other and AWM selected. I calculate values for Other differently and AWM differently and return summed up numbers.
nayan28apr , in the first version, can try var like these example and check
Var Contingency = If(Countx(filter(SALLSELECTED(SonarSabo[franchise]),SonarSabo[franchise] ="Contingency"),SonarSabo[franchise])+0 >0 ,
CALCULATE(u,SonarSabo[franchise]="Contingency"),0)
2 Replies
- amitchandak
Super User
nayan28apr , in the first version, can try var like these example and check
Var Contingency = If(Countx(filter(SALLSELECTED(SonarSabo[franchise]),SonarSabo[franchise] ="Contingency"),SonarSabo[franchise])+0 >0 ,
CALCULATE(u,SonarSabo[franchise]="Contingency"),0) - v-lionel-msft
Community Support
Hi nayan28apr ,
Please try to do like this.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.