Forum Discussion
If function
- 4 years ago
This code should work if you are writing a calculated column that has the row context to make sense of it.
However, for a measure, it doesn't automatically know which row you're referring to when you write "test[item]", so you need to use an aggregation like MAX or SELECTEDVALUE like this:
IF ( SELECTEDVALUE ( test[item] ) = "A", 1, 0 ) - 4 years ago
1. I'd probably write that like this:
IF ( SELECTEDVALUE ( test[item] ) IN { "A", "B", "C" }, 1, 0 )2. Font face cannot be conditionally formatted like font color and background color can be. Not yet anyway.
You may want to vote and comment on related ideas like this one:
https://ideas.powerbi.com/ideas/idea/?ideaid=29c97607-0484-4f4a-821a-d1a43ff9fc41
This code should work if you are writing a calculated column that has the row context to make sense of it.
However, for a measure, it doesn't automatically know which row you're referring to when you write "test[item]", so you need to use an aggregation like MAX or SELECTEDVALUE like this:
IF ( SELECTEDVALUE ( test[item] ) = "A", 1, 0 )