Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi.
The slicer is a field parameter.
In the slicer, I select something, and the value is shown in the lower part of the KPI. I would like to change the color of the selected value (now 12.97%) to green if it's >0 and red if it is <0.
How can I do that? I used SELECTEDVALUE and SWITCH TRUE () and it didn't work.
Thanks!
Solved! Go to Solution.
You will need to create a measure that calculates the value you want to display. This measure should evaluate to the percentage you mentioned.
SelectedValueMeasure =
IF(
SELECTEDVALUE(YourTable[YourColumn]) > 0,
[YourPositiveMeasure],
[YourNegativeMeasure]
)
You'll then want to create a KPI or Card visual using this measure.
To apply the color formatting based on the value, you will need to do the following:
- Click on the KPI or Card visual that you want to format.
- Go to the "Format" pane.
- Click on "Conditional formatting."
- Select the option to format, such as "Data labels" or "Font color."
- Choose "Format by field value" and select the measure you created.
- Set the rules for the formatting, such as green for values greater than 0 and red for values less than 0.
@AndreeaV I understood what you are trying to achieve and the selectedvalue function in this case will not work. This is a shortcoming in field parameters when you want to get the measure value based on the selected field parameter but there is a workaround that basically makes field parameters useless (in this example).
👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The labels (e.g. "Yearly price change MSFT") in the field parameter slicer are measures. I tried SELECTEDVALUE and it doesn't seem to work with parameters, because it treats the selected values as text.
In Power BI, slicers don't directly interact with measures, as slicers typically filter data based on a column in a table, while measures perform calculations on that data.
If you have a measure like "Yearly price change MSFT" that you want to control via a slicer, you may need to rethink your approach. Here's one way you might accomplish this:
Can you please share your pbix file ?
You will need to create a measure that calculates the value you want to display. This measure should evaluate to the percentage you mentioned.
SelectedValueMeasure =
IF(
SELECTEDVALUE(YourTable[YourColumn]) > 0,
[YourPositiveMeasure],
[YourNegativeMeasure]
)
You'll then want to create a KPI or Card visual using this measure.
To apply the color formatting based on the value, you will need to do the following:
- Click on the KPI or Card visual that you want to format.
- Go to the "Format" pane.
- Click on "Conditional formatting."
- Select the option to format, such as "Data labels" or "Font color."
- Choose "Format by field value" and select the measure you created.
- Set the rules for the formatting, such as green for values greater than 0 and red for values less than 0.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
40 | |
31 | |
27 | |
27 |