Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
cm008507
Frequent Visitor

conditional formatting for monthly actuals based on monthly target where each row is a unique KPI

Hi there,  I am new to PoweBI desktop and attempting to creating a table with different KPIs in column 1 with annual target nalue in column 2, and actual monthly performance values for the fiscal year in the subsequent columns. 

 

I'd like to have conditional formating for each month's actual values based on the annual target value for each KPI.  As each row contains a unique KPI, the formatting rules will be unique to each row.   Thresholds and table layout shown below.

 

 RedAmberGreen/BestAmberRed
KPI1< 80%80% to 95%> 95%  
KPI2  <=0.200.20 to 0.25>0.25
KPI3  <= 4.54.5 to 4.6>4.6
KPI4  <= 4.54.5 to 4.6>4.6
KPI5< 60%60% to 80%80% to 100%101% to 105%>105%

 

KPI Name2022 TargetJan ActualFeb ActualMar Actual
KPI1 $                9.69 $        9.83 $       10.15 $    14.25
KPI20.210.260.190.21
KPI34.004.554.604.70
KPI4 $            211.00 $    175.00 $     225.00 $  210.00

 

What is the best way to do this?   Thank-you in advance.

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @cm008507 

I'm afraid there is currently no other better way, you have to apply conditional formatting column by column.

Example (conditional formating for column 'Jan actual')

formatting_Jan = 
SWITCH (
    MAX ( 'Fact Table'[KPI Name] ),
    "KPI1",SWITCH (TRUE (),[Jan_Actualvalue] < 0.8, "Red",[Jan_Actualvalue] <= 0.95, "#ffbf00",[Jan_Actualvalue] > 0.95, "light Green"),
    "KPI2",SWITCH (TRUE (),[Jan_Actualvalue] <= 0.20, "light Green",[Jan_Actualvalue] <= 0.25,"#ffbf00",[Jan_Actualvalue] > 0.25, "Red"),
    "KPI3",SWITCH (TRUE (),[Jan_Actualvalue] <= 4.5, "light Green",[Jan_Actualvalue] <= 4.6, "#ffbf00", [Jan_Actualvalue] > 4.6, "Red" ),
    "KPI4",SWITCH (TRUE (),[Jan_Actualvalue] <= 4.5, "light Green", [Jan_Actualvalue] <= 4.6, "#ffbf00",[Jan_Actualvalue] > 4.6, "Red"),
    "KPI5",SWITCH (TRUE (), [Jan_Actualvalue] < 0.6, "Red",[Jan_Actualvalue] <= 0.8, "#ffbf00",[Jan_Actualvalue] <= 1, "light Green",[Jan_Actualvalue] <= 1.05, "#ffbf00",[Jan_Actualvalue] > 1.05,"Red")
)

veasonfmsft_1-1659936040786.png

 

 

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @cm008507 

I'm afraid there is currently no other better way, you have to apply conditional formatting column by column.

Example (conditional formating for column 'Jan actual')

formatting_Jan = 
SWITCH (
    MAX ( 'Fact Table'[KPI Name] ),
    "KPI1",SWITCH (TRUE (),[Jan_Actualvalue] < 0.8, "Red",[Jan_Actualvalue] <= 0.95, "#ffbf00",[Jan_Actualvalue] > 0.95, "light Green"),
    "KPI2",SWITCH (TRUE (),[Jan_Actualvalue] <= 0.20, "light Green",[Jan_Actualvalue] <= 0.25,"#ffbf00",[Jan_Actualvalue] > 0.25, "Red"),
    "KPI3",SWITCH (TRUE (),[Jan_Actualvalue] <= 4.5, "light Green",[Jan_Actualvalue] <= 4.6, "#ffbf00", [Jan_Actualvalue] > 4.6, "Red" ),
    "KPI4",SWITCH (TRUE (),[Jan_Actualvalue] <= 4.5, "light Green", [Jan_Actualvalue] <= 4.6, "#ffbf00",[Jan_Actualvalue] > 4.6, "Red"),
    "KPI5",SWITCH (TRUE (), [Jan_Actualvalue] < 0.6, "Red",[Jan_Actualvalue] <= 0.8, "#ffbf00",[Jan_Actualvalue] <= 1, "light Green",[Jan_Actualvalue] <= 1.05, "#ffbf00",[Jan_Actualvalue] > 1.05,"Red")
)

veasonfmsft_1-1659936040786.png

 

 

Best Regards,
Community Support Team _ Eason

Thank-you for your assistance.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors