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?

Mar 17 in Power BI by Evanjalin
• 25,690 points
110 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 Mar 17 by anonymous
• 25,690 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
• 22,890 points
177 views
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 Mar 17 in Power BI by anonymous
• 25,690 points
97 views
0 votes
1 answer

How can I create a multi-row card that dynamically adjusts based on the number of selected values?

To create a multi-row card in Power ...READ MORE

answered Mar 18 in Power BI by anonymous
• 25,690 points
74 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,233 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,048 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,402 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

How do I create a calculation that applies different filters based on a user-selected slicer option?

Disconnected Table with DAX Measure using SWITCH() ...READ MORE

answered Mar 25 in Power BI by anonymous
• 25,690 points
86 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