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
dange187
Frequent Visitor

Calculation Group Condiftional Formatting not working

I have a model where I have 1 calculation group for time intelligence. I am using it in a matrix so users can select what time intelligence options they see via a slicer for the calculation group. I want to apply conditional formatting to the growth measures to highlight green for positive growth, red for negative growth. I've found several articles about using the measure:

CFMeasure = IF ( SELECTEDVALUE( 'calcgrouptable'[calcgroup]) IN {"PM∆"},
[measure],
BLANK()

)

then using this in the conditional formatting for the table.

What is happening is, instead of the calculated item being shown in the result, the actual (uncalculated) value is shown so the conditional formatting isn't in the right context. When I add the conditional formatting measure to the table you can see the result is not as expected:

dange187_0-1713971316644.png

I suspect this may have something to do with precedence but I dont have any other calculation groups and I tried different precedence values to see if it would help, but nothing. 

1 ACCEPTED SOLUTION
dange187
Frequent Visitor

I think I've figured out why this was not working but I dont fully understand the why.

The calculation items I am trying to apply the formatting to are difference calculations so for example TY-PY. In the calculation I was using the format:

SELECTEDMEASURE()-
CALCULATE(
      SELECTEDMEASURE(),
                 'calcgroup'[calcitem] = "PM"

)

I noticed that when I changed to the process in the video shared by @parry2k (thanks) that the measures which didnt reference other calculation items were working correctly. So I changed the second part of the above formula to just do the calculation for PM and not reference the other calculation item and...
IT WORKS!

Like I said, I dont really understand why it works this way and not the other, but whatever works. Now to change all my calculations items!

View solution in original post

2 REPLIES 2
dange187
Frequent Visitor

I think I've figured out why this was not working but I dont fully understand the why.

The calculation items I am trying to apply the formatting to are difference calculations so for example TY-PY. In the calculation I was using the format:

SELECTEDMEASURE()-
CALCULATE(
      SELECTEDMEASURE(),
                 'calcgroup'[calcitem] = "PM"

)

I noticed that when I changed to the process in the video shared by @parry2k (thanks) that the measures which didnt reference other calculation items were working correctly. So I changed the second part of the above formula to just do the calculation for PM and not reference the other calculation item and...
IT WORKS!

Like I said, I dont really understand why it works this way and not the other, but whatever works. Now to change all my calculations items!

parry2k
Super User
Super User

@dange187 check this video if it helps Why simple conditional formatting is not simple anymore with Calculation Groups - Power BI - YouTube



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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