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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Nisha357
New Member

Matrix visual conditional formatting issue

Nisha357_0-1749189830239.png

Delivery_KPI_Color =
VAR Key2 = UPPER(TRIM(MAX('Append KPI_(Actuals+Target)'[Key2])))
VAR ActualRaw = [Monthly Actual]
VAR TargetRaw = [Monthly Target]

VAR Actual =
IF(
ISNUMBER(ActualRaw),
ActualRaw,
VALUE(SUBSTITUTE(SUBSTITUTE(ActualRaw, "%", ""), "M", ""))
)

VAR Target =
IF(
ISNUMBER(TargetRaw),
TargetRaw,
VALUE(SUBSTITUTE(SUBSTITUTE(TargetRaw, "%", ""), "M", ""))
)

-- Treat blanks as 0
VAR ActualFixed = IF(ISBLANK(Actual), 0, Actual)
VAR TargetFixed = IF(ISBLANK(Target), 0, Target)

RETURN
SWITCH(
TRUE(),
Key2 = "PRODUCTION VOLUME - MONTHLY ACTUAL" && ActualFixed >= TargetFixed, 1,
Key2 = "PRODUCTION VOLUME - MONTHLY ACTUAL" && ActualFixed < TargetFixed, 0,

Key2 = "OEE - MONTHLY ACTUAL" && ActualFixed >= TargetFixed, 1,
Key2 = "OEE - MONTHLY ACTUAL" && ActualFixed < TargetFixed, 0,

Key2 = "PPA - MIX ADHERENCE - MONTHLY ACTUAL" && ActualFixed >= TargetFixed, 1,
Key2 = "PPA - MIX ADHERENCE - MONTHLY ACTUAL" && ActualFixed < TargetFixed, 0,

Key2 = "BRL (T1-T4) SCF" && ActualFixed <= TargetFixed, 1,
Key2 = "BRL (T1-T4) SCF" && ActualFixed > TargetFixed, 0,

Key2 = "DIOH (RM + WIP + FERT AT PLANT) - MONTHLY ACTUAL" && ActualFixed <= TargetFixed, 1,
Key2 = "DIOH (RM + WIP + FERT AT PLANT) - MONTHLY ACTUAL" && ActualFixed > TargetFixed, 0,

BLANK()
)----- I have it measure it fails to recongize the values greater then and less then target. How to fix it?@BhavinVyas3003@burakkaragoz

1 ACCEPTED SOLUTION

Hi @Nisha357 

Thank you for reaching out to the Microsoft Fabric Forum Community.

Please try below points, 

  • Switched from MAX() to SELECTEDVALUE()  so the measure works correctly for each row in the matrix. MAX() can give unexpected results when multiple values exist in the context.
  • Used [Monthly Actual] and [Monthly Target] directly because they are already numeric. No need to use VALUE() or SUBSTITUTE(), which can cause comparison issues.
  • Handled blank values by treating them as 0 to prevent errors and ensure the conditional formatting logic runs smoothly.

    If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.

View solution in original post

6 REPLIES 6
Nisha357
New Member

[Monthly Actual] and [Monthly Target] are numeric measures

Hi @Nisha357 

Thank you for reaching out to the Microsoft Fabric Forum Community.

Please try below points, 

  • Switched from MAX() to SELECTEDVALUE()  so the measure works correctly for each row in the matrix. MAX() can give unexpected results when multiple values exist in the context.
  • Used [Monthly Actual] and [Monthly Target] directly because they are already numeric. No need to use VALUE() or SUBSTITUTE(), which can cause comparison issues.
  • Handled blank values by treating them as 0 to prevent errors and ensure the conditional formatting logic runs smoothly.

    If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.

Hi @Nisha357 

I hope the information shared was helpful to you. If your question has been answered, kindly mark the most relevant reply as the Accepted Solution. This small action can make a big difference for others who are looking for the same solution.

 

Hi @Nisha357 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

Hi @Nisha357 

Hope everything’s going smoothly on your end. We haven’t heard back from you, so I wanted to check if the issue got sorted. If yes, marking the solution would be awesome for others who might run into the same thing.

 

maruthisp
Super User
Super User

Hi Nisha357,

Can you please check if the data types are correct for [Monthly Actual] and [Monthly Target] are numeric measures or text?

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

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.