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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Justas4478
Responsive Resident
Responsive Resident

Separate font color Conditional formattings

Hi, I am creating font conditional formatting for one of my value in the table.
The only problem is that you cant create multiple rules for font formating for same value.
I would like to know is there some way how I could create two Font color conditional formattings, one for value only and other for totals only.
If even possible for grand totals as well.

Justas4478_0-1714049030210.png 
Thanks.

 

6 REPLIES 6
DataInsights
Super User
Super User

@Justas4478,

 

Try this solution.

 

1. Create the measure below using the dimension field in your visual. HASONEVALUE determines if the row is a total.

 

Conditional Formatting = 
IF ( HASONEVALUE ( Table1[Code] ), "#298B46", "#A8337D" )

 

2. In the conditional formatting screen, select the measure above. Apply to values and totals.

 

DataInsights_0-1714068241981.png

 

Result:

 

DataInsights_1-1714068258053.png

 





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

Proud to be a Super User!




@DataInsights I unfortunatelly can't use this since my source of data is a measure and not a column.
Is it possible to make it work for a measure?
As well I will ask since I forgot.
Can the conditional formating be made to apply colors to specified data range?
For example if it is not total and value is >=0 and 3< do [color hex], >2 and 6< do [color hex].
And then similar for total values.
As well I dont know if it makes any difference but my data is using live connection model so I am locked for using only measures.

@Justas4478,

 

This should work with a live connection since it's a measure. The column in HASONEVALUE is the field in your matrix rows. Yes, you can specify data ranges in the measure to apply colors accordingly. If you provide your measure I can take a look.





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

Proud to be a Super User!




@DataInsights This is the measure that I need to apply conditional formatting to:

Days Shorted = VAR _Table =
    SUMMARIZE(
         'Outbound Delivery',
         'Product Category'[Level 2],
         'Date'[Date],
         "@Shorted", 'Outbound Delivery'[Shorted Qty]
    )
VAR _Result =
    COUNTX(
        FILTER(
             _Table,
              [@Shorted] <> 0
        ),
        [@Shorted]
    )
RETURN
  _Result 

I dont know is it possible to incorporate in to this measure.

@Justas4478,

 

The measure you provided doesn't need to be changed. Simply create the measure I provided (using the specific column in your matrix rows) and use that new measure in the conditional formatting of your main measure.





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

Proud to be a Super User!




@DataInsights Morning, unfortunatelly I cant use dax you provided since it only works with calculated columns:

Justas4478_2-1714376317565.png

Where I am using measure and not a column as value:

Justas4478_1-1714376288158.png

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.