Forum Discussion
cosminc
Post Partisan
7 years agoMeasure with if with filtered value
Hi, I try to create a measure based on a filter value and an if something like this: if(source(salesmen) slicer="George",4, if(source(salesmen) slicer ="Mary",0)) can you help me please with the ...
- 7 years ago
you need SELECTEDVALUE, I'd also consider wheter you want to use BLANK - calculation wise it acts as 0, display wise it acts as null
IF( SELECTEDVALUE(Source[Salesman]) = "George", 4, IF( SELECTEDVALUE(Source[Salesman]) = "Mary", 0, BLANK() ) )
Stachu
Community Champion
7 years agoyou need SELECTEDVALUE, I'd also consider wheter you want to use BLANK - calculation wise it acts as 0, display wise it acts as null
IF(
SELECTEDVALUE(Source[Salesman]) = "George",
4,
IF(
SELECTEDVALUE(Source[Salesman]) = "Mary",
0,
BLANK()
)
)cosminc
Post Partisan
7 years agoHi
It works fine!
Thanks,
Cosmin