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! Request now

Reply
Anonymous
Not applicable

custom conditional formatting?

Hey guys, basically I have these three columns and I need to make conditional formatting so as that if first column value exceeds second column value, then return the difference. Otherwise, if it does not exceed the value, return 0:00:00 In a time value. Any ideas how to do that? 
Many thanks

 

Gediminas12_0-1600251960208.png

 

 

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

what about the following solution:

 

16-09-_2020_12-59-05.png

 

Difference = 
VAR _Calculation = CALCULATE(
                            MIN('Table'[naujasbandymas]) - MIN('Table'[norma]), 
                            FILTER('Table', 'Table'[naujasbandymas] >= 'Table'[norma])
                    )
RETURN
    IF(_Calculation = BLANK(),TIME(0,0,0), _Calculation)

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

6 REPLIES 6
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

what about the following solution:

 

16-09-_2020_12-59-05.png

 

Difference = 
VAR _Calculation = CALCULATE(
                            MIN('Table'[naujasbandymas]) - MIN('Table'[norma]), 
                            FILTER('Table', 'Table'[naujasbandymas] >= 'Table'[norma])
                    )
RETURN
    IF(_Calculation = BLANK(),TIME(0,0,0), _Calculation)

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Anonymous
Not applicable

@FrankAT You might be able to help me now. 

This is my table. First column is time in the whole number format and then second one is norm that should not be exceeded, if it exceeds this norm, then return the difference(Third column) between the two, but if it does not exceed 04:30 then return the actual time. 

 

Gediminas12_0-1600412176354.png

 

 

Anonymous
Not applicable

@FrankAT 

That would actually be my ideal solution, however i get the following error : 

Gediminas12_0-1600254513252.png

 

Hi @Anonymous 

the MIN() function doesn't accept a measure as an argument. If [naujasbandymas] is a measure my formula fails.

How does your measures and tables look like?

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

 

Anonymous
Not applicable

Yes, i managed to change it from the measure to actual variable and it works perfectly now, many many thanks. 

amitchandak
Super User
Super User

@Anonymous , you can create a color measure and use that in conditional formatting using "Field Value" Option

 

color =
switch ( true(),
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"lightgreen",
// Add more conditions
"red"
)

 

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors