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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
masplin
Impactful Individual
Impactful Individual

Conditional formatting in Power BI with calculation groups (for multiple measures at once)

The above question was asked last year by another user and never got an answer. 

 

This guy des a good job of explain how to get conditional formating for some calcuation items if you have a single measure or if you are using a variable to select measures. https://www.youtube.com/watch?v=MbxJ1oHHyTg&t=416s . The below works fine for a single measure.

 

   IF (
        SELECTEDVALUE ( TimeIntelligence[Formula] ) IN { "MoM","MoM %" },
         [New Users],
         BLANK())

 

 

however the question if you have multiple measures and multiple calcuations items like this, how to get conditional formating for all/some measures for some of the calcuation items

 

Capture.JPG

 

So I want different font colour above and below 0 for MoM and MOM %

 

I tried this suggested in previous post but doesnt work. It doesnt seem SELECTEDMEASURENAME actual works in this context.

Conditional% = 
VAR currMeasure =
   SELECTEDMEASURENAME()
RETURN
    IF (
        SELECTEDVALUE ( TimeIntelligence[Formula] ) IN { "MoM","MoM %" },
        SWITCH (
            currMeasure,
            "New Users", [New Users],
            "New Customers", [New Customers]
            
        ),
        BLANK()
    )

 

I'm sure thisisint hard, but beyond my capabilites ot work out thesyntax. Thanks for any advice

 

Mike

2 REPLIES 2
MFelix
Super User
Super User

Hi @masplin ,

 

This can be created using a Calculation Group, check the video below that explains how you can use Calculation Groups to make this happening.

 

https://www.youtube.com/watch?v=YU5nddHQ-oo


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



masplin
Impactful Individual
Impactful Individual

Hi. I watched this, but too be honest no idea how this related to what I am after.  I cant even understand how he is creating a Colour measure that refers to a calcuation Item. I tried to do that wthin Tabular Editor and just got errors.   

 

I want to colour calcuation item MoM so created a calculation Item Red = IF([MoM]<0,"Red")  but MoM cant be determined. At some point he added the [Color] measure but no idea how he did that.  It cant be a modle measure as you can't refer to a claucation item in a measure can you?   Ah I think he is using a measure formt he modle not the one created by the calcuation group. That defeats the object of using calculation groups as I have create a 2nd version on MoM in the model just to do the formatting. 

 

I think the idea above of 

IF (
        SELECTEDVALUE ( TimeIntelligence[Formula] ) IN { "MoM","MoM %" },
         [New Users],
         BLANK())

 

is much more elegant andless clumsy, but must be possible to make it apply to multiple measures?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.