How do I create a dynamic KPI card that changes color based on user-selected thresholds

0 votes

How do I create a dynamic KPI card that changes color based on user-selected thresholds?
I am building a KPI card in Power BI that should dynamically change its background or text color based on threshold values selected by the user. The thresholds should be adjustable using slicers or parameters. What is the best way to implement this using conditional formatting in Power BI, combined with DAX expressions for dynamic rule-based formatting?

5 hours ago in Power BI by Evanjalin
• 19,660 points
11 views

1 answer to this question.

0 votes

To create a dynamic KPI card that allows threshold values to be selected by the user and causes the card to change colors in Power BI, follow through the following steps:

Create User-Selectable Thresholds

Make use of a What-if Parameter or a separate table containing threshold values (for example: "Low," "Medium," "High").

Allow for user threshold selection through a slicer.

2. Write a DAX Measure for Conditional Formatting

Build a measure that compares KPI values with the threshold selected and assigns a color accordingly.

Example DAX: 

SelectedThreshold = SELECTEDVALUE(ThresholdTable[Threshold])  
 
KPIColor =  
SWITCH(TRUE(),  
    [KPI Value] < SelectedThreshold * 0.5, "Red",  
    [KPI Value] < SelectedThreshold, "Yellow",  
    "Green"  
)

3. Apply Conditional Formatting

  • In the KPI card visual, go to Format → Data Label / Background → Conditional Formatting and set it to use the KPIColor measure.

answered 4 hours ago by anonymous
• 19,660 points

Related Questions In Power BI

0 votes
0 answers
0 votes
2 answers

How do I create a Power BI visual that dynamically adjusts based on user-selected filters and slicers?

The application of slicers and filters in ...READ MORE

answered Jan 23 in Power BI by anonymous
• 16,900 points
137 views
+1 vote
2 answers

How do I create interactive dashboards that adjust based on user roles or permissions?

When designing interactive dashboards in Power BI ...READ MORE

answered Nov 19, 2024 in Power BI by pooja
• 16,900 points
151 views
0 votes
1 answer

How do I create a Power Query function that dynamically adjusts based on input parameters?

If you want to build a Power ...READ MORE

answered 4 days ago in Power BI by anonymous
• 19,660 points
40 views
0 votes
1 answer

Install Power BI Desktop

It’s a pretty simple process. All you ...READ MORE

answered Oct 9, 2018 in Power BI by Kalgi
• 52,350 points
1,204 views
0 votes
1 answer

Few tips before I start creating Power BI dashboard

It’s always advisable to begin with the data ...READ MORE

answered Oct 9, 2018 in Power BI by Kalgi
• 52,350 points
1,019 views
0 votes
1 answer

How do I format the KPI in Power BI

format the KPI by selecting the paint ...READ MORE

answered Oct 9, 2018 in Power BI by Kalgi
• 52,350 points
1,366 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

How can I create a function in Power Query that processes data differently based on a user-selected parameter?

The following steps outline the creation of ...READ MORE

answered 4 hours ago in Power BI by anonymous
• 19,660 points
9 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP