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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Mk60
Resolver I
Resolver I

Calculated Column conditional formatting-works for some but not for all columns??

I have created table with calculated columns 1-9, (attachment#1), and I know that my condition Rules work fine b/c I can see that my percentages are matching the actual reporting calculations for each month, (Jan23-Nov23). Example-column 8 shows 280.06% in red-orange color which I assigned, (as in attachment#2). So, Rules for all of the columns1-9 work as expected. However, when I try to do conditional formatting to my column H, which is based on the data from my column 8, and should display specific text, it does NOT show accurate name, which for Aug23 should be "Caution" in column H, instead of Watch,(attachment#3).And I have the same issue in column I where only top 2 rows in yellow should be yellow "Watch", but everthing below should be showing "Caution" in red color. I can not see what I may be doing wrong here, since all green cells "Appetite" seem to be working fine. I used this simple DAX calculation to create my new Masures, (attachment#4), and I am not sure if that calculation may be the problem, since it is working ok for "Appetite" category? I hope I provided sufficent information here. Please advise. 

#1

Mk60_0-1704316567792.png

#2

Mk60_1-1704316613389.png

#3

Mk60_2-1704316639135.png

#4

Mk60_4-1704316767348.png

 

 

2 ACCEPTED SOLUTIONS
v-binbinyu-msft
Community Support
Community Support

Hi @Mk60 ,

Please try create a column with below dax formula:

Column H =
VAR _a = [Column 8]
VAR _b =
    SWITCH (
        TRUE (),
        _a <= 2.60, "Appetite",
        _a > 2.60
            && _a <= 2.80, "Watch",
        _a > 2.8
            && _a <= 3.00, "Caution",
        _a > 3.00, "Limit"
    )
RETURN
    _b

Add a table visual with table fields and set conditional formatting:

vbinbinyumsft_0-1704334400994.png

 

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi there,


Worked perfectly!! Just wanted to express my gratitude for your time and consideration. I was aware of the Switch option, but never seen or used one with VAR before. Once again, thank you so very much. Greatly appreciated!

mk

View solution in original post

2 REPLIES 2
v-binbinyu-msft
Community Support
Community Support

Hi @Mk60 ,

Please try create a column with below dax formula:

Column H =
VAR _a = [Column 8]
VAR _b =
    SWITCH (
        TRUE (),
        _a <= 2.60, "Appetite",
        _a > 2.60
            && _a <= 2.80, "Watch",
        _a > 2.8
            && _a <= 3.00, "Caution",
        _a > 3.00, "Limit"
    )
RETURN
    _b

Add a table visual with table fields and set conditional formatting:

vbinbinyumsft_0-1704334400994.png

 

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi there,


Worked perfectly!! Just wanted to express my gratitude for your time and consideration. I was aware of the Switch option, but never seen or used one with VAR before. Once again, thank you so very much. Greatly appreciated!

mk

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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