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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Conditional Formating both £ Values and % Values

Hi Experts 

 

I have managed to format the £ values numbers in my matrix table as Red but I am unable to do the same for % values.

 

Link.

https://www.dropbox.com/s/h611uzqxduhgv3e/sample.pbix?dl=0 

 

When replying to question kindly outline steps do not post a pbix file. Thanks

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

This is due to the fact that when you are making the change of the % to a FORMAT syntax you are picking up text and not a value so the condittional formatting will not assume the number formatting.

 

What you need to do is to create a measure exactly like the Slicer_CM but for formatting.

 

 

Slicer_CM_Formatting = 
VAR Mth1 =
    SELECTEDVALUE ( SelMth_Current[Month] )
VAR Mth2 =
    SELECTEDVALUE ( SelMth_Prior[Month] )
VAR Fcst1 =
    SELECTEDVALUE ( SelMth4[Actual] )
VAR Fcst2 =
    SELECTEDVALUE ( SelMth3[Actual] )

VAR Opt = 0

VAR MthVal =
    
        CALCULATE (
                SUM ( Profitability_Consolidation[Profit]);
                Profitability_Consolidation[Period] = Fcst1;Profitability_Consolidation[Month] = Mth1
            )
VAR MTDValue =
    SWITCH ( TRUE();
        AVERAGE ( Profitability_Consolidation[Chkfmt] ) =        1 && MthVal <0 ;"Red";
                [Slicer_CM] <0; "Red"
    )         
 RETURN
    MTDValue

 

 

Now just use this measure has your formatting value, the "RED" can be change by any colour you want if you use a HEX colourings similar to this "#000000".

 

MFelix_0-1607682025263.png

 


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



View solution in original post

6 REPLIES 6
MFelix
Super User
Super User

Hi @Anonymous ,

 

This is due to the fact that when you are making the change of the % to a FORMAT syntax you are picking up text and not a value so the condittional formatting will not assume the number formatting.

 

What you need to do is to create a measure exactly like the Slicer_CM but for formatting.

 

 

Slicer_CM_Formatting = 
VAR Mth1 =
    SELECTEDVALUE ( SelMth_Current[Month] )
VAR Mth2 =
    SELECTEDVALUE ( SelMth_Prior[Month] )
VAR Fcst1 =
    SELECTEDVALUE ( SelMth4[Actual] )
VAR Fcst2 =
    SELECTEDVALUE ( SelMth3[Actual] )

VAR Opt = 0

VAR MthVal =
    
        CALCULATE (
                SUM ( Profitability_Consolidation[Profit]);
                Profitability_Consolidation[Period] = Fcst1;Profitability_Consolidation[Month] = Mth1
            )
VAR MTDValue =
    SWITCH ( TRUE();
        AVERAGE ( Profitability_Consolidation[Chkfmt] ) =        1 && MthVal <0 ;"Red";
                [Slicer_CM] <0; "Red"
    )         
 RETURN
    MTDValue

 

 

Now just use this measure has your formatting value, the "RED" can be change by any colour you want if you use a HEX colourings similar to this "#000000".

 

MFelix_0-1607682025263.png

 


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



Anonymous
Not applicable

Hi MFelix...how do i format the values not % to 1dp. Currently 2dp.

Hi @Anonymous ,

 

Sorry I'm not understanding the question. What is the 1 / 2 dp?


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



Anonymous
Not applicable

Many thanks MFleix much appreciated for excellent feedback. Ps can you remove the sample pbix file from question i have down loaded it now.

Done.


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



Anonymous
Not applicable

Many thanks sir.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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