Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I am trying to write an IF statement where I would like my arrows to go up and down accordin to the value and change its colour at the same time.
I am doing the change of colour by nesting two IF statement as I don't have the option to use conditional formating in the measure I have created using UNICHAR. I know something is wrong but I can't figure out.
Please any guidance would be really appreciated.
Thank you,
Aziza
Solved! Go to Solution.
Hi @Anonymous
Download PBIX example with solution
I'm not sure if you are using columns or measures in your IF but it doesn't matter I guess for the purposes of my example.
What you need to do is create a measure for the value,
_DEBT Diffs = IF (SUM('Sheet2'[Debt Recovered]) > SUM('Sheet2'[Debt Value]), UNICHAR(9660), UNICHAR(9650))
and create another measure for the color.
_DEBT Diffs Color = IF (SUM('Sheet2'[Debt Recovered]) > SUM('Sheet2'[Debt Value]), "#FF0000", "#66ff33")
Then you can set conditional formatting like so
Regards
Phil
Proud to be a Super User!
Hi @Anonymous ,
Your error is due to the wrong use of if.
IF(<logical_test>, <value_if_true>[, <value_if_false>])
or
IF(<logical_test1>,if(<logical_test2>, <value_if_true2>[, <value_if_false2>]),<value_if_false1>)
In addition colormeasure is used as a formatting condition, rather than acting directly on measures or columns.
You could use Unichar(128315) get red down arrow,but no unicode for green arrow up ,and we can use (9650) grey arrow and switch to green under column formating, select the measure Arrows changue font color to 00B200 and activate all options except Header.
To learn more details ,you could refer the following articles:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @Anonymous
Download PBIX example with solution
I'm not sure if you are using columns or measures in your IF but it doesn't matter I guess for the purposes of my example.
What you need to do is create a measure for the value,
_DEBT Diffs = IF (SUM('Sheet2'[Debt Recovered]) > SUM('Sheet2'[Debt Value]), UNICHAR(9660), UNICHAR(9650))
and create another measure for the color.
_DEBT Diffs Color = IF (SUM('Sheet2'[Debt Recovered]) > SUM('Sheet2'[Debt Value]), "#FF0000", "#66ff33")
Then you can set conditional formatting like so
Regards
Phil
Proud to be a Super User!
User | Count |
---|---|
86 | |
82 | |
68 | |
64 | |
55 |
User | Count |
---|---|
120 | |
99 | |
91 | |
83 | |
65 |