Forum Discussion
mmills2018
Helper IV
5 years agoIf/or statement with slicers
Hello, I have the below meaure in power bi, for my "return" i want to set it up so if i to (PoC[PoC (USA Only)]) it will give me my PoC calc (cta_rawpoc) and if i filter to ( Gender[Gender] ) it wi...
- Anonymous5 years ago
Hi mmills2018 ,
If I understand you correctly, you could use ISFILTERED() function with SWITCH() or IF() function.
For example:
SWITCH(TRUE(),ISFILTERED(slicer1),measure1,ISFILTERED(slicer2),measure2,measure3).
Measure = var _a = CALCULATE(DISTINCTCOUNT('Table'[Associate ID]),FILTER('Table','Table'[Company]=SELECTEDVALUE('Table'[Company])&&'Table'[Potential]<>BLANK())) var _b = CALCULATE(DISTINCTCOUNT('Table'[Associate ID]),FILTER('Table','Table'[Company]=SELECTEDVALUE('Table'[Company]))) return _a/_b Measure 2 = var _a = CALCULATE(DISTINCTCOUNT('Table'[Associate ID]),FILTER('Table','Table'[Company]=SELECTEDVALUE('Table'[Company])&&'Table'[Potential]<>BLANK())) var _b = CALCULATE(DISTINCTCOUNT('Table'[Associate ID]),FILTER(ALL('Table'),'Table'[Company]=SELECTEDVALUE('Table'[Company])&&'Table'[Potential]<>BLANK())) return _a/_bThe same for the POC slicer.
Best Regards,
Jay
mmills2018
Helper IV
5 years agothanks but my filters are not connected to the data source. I need an If Poc is filter then XYZ, if gender is filter than XYZ
mmills2018
Helper IV
5 years agoHi parry2k any ideas?