Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 correct syntax?
Thanks,
Cosmin
Solved! Go to Solution.
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()
)
)
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()
)
)
Hi guys,
I do have a similar issue. This quick measure does not work. Does anyone have an idea?
Hi
I have a similar situation but it doesn't works
In a base i have column Year and Fiscal Year (Year<9,Year,Year+1)
and now i need to make a column which is Year or Fiscal year and use it instead of simple Year column on grpahs, slicers etc
in addition with this i made a table in query editor with 2 values and a slicer with them in report visualization
and i need when i filter one value the Year switchable column to be Year, or i select the other value and will be Year Fiscal
but it does't work, the calculated column is blank
Hi
It works fine!
Thanks,
Cosmin
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 60 | |
| 43 | |
| 40 | |
| 36 | |
| 21 |
| User | Count |
|---|---|
| 177 | |
| 123 | |
| 110 | |
| 77 | |
| 51 |