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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LLuet
New Member

Conditional formatting based on a comparison of two numbers

Hello everyone,


I have a question about Conditional Formatting and would really appreciate if someone could help me.

 

Initial situation:
I have a matrix with three columns:
1. event type
2. total number of events (of the type) that have already taken place
3. total number of events (of the type) that should be reached

 

Question: Is there a way to color-code the actual numbers, for example red if they do not yet meet the target numbers and green if the targeted total number has already been reached ?

 

Thanks a lot 🙂

 

1 ACCEPTED SOLUTION

@LLuet 
Try to add a measure to find the meet target status and then use that to set up the conditional formatting.

measure would be something like this:

 

measure=
Var _Variance = if([type] = A, [No. taken place]-39,[No. taken place]-8)
\\to find the variance between the actual vs forecast
return
if(_Variance>=0,True(),False()
\\ if _variance equal or bigger that 0, it means target has been met

 

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

Appreciate your Kudos VahidDM_0-1630589112216.png !!

View solution in original post

4 REPLIES 4
LLuet
New Member

First of all, thanks for the quick answers, but the correct solution was probably not there yet.

 

I understand how normal conditional formatting works, but in my case I can't specify a threshold. To clarify the problem, here is a short example:

Event type A has taken place 23 times, but is supposed to take place 39 times. Event type B has taken place 15 times, although only 8 were planned.

 

Since the threshold value is different, I cannot specify a certain number from which a condition was met or not met. The numbers for each event type must be compared individually.

 

@LLuet 
Try to add a measure to find the meet target status and then use that to set up the conditional formatting.

measure would be something like this:

 

measure=
Var _Variance = if([type] = A, [No. taken place]-39,[No. taken place]-8)
\\to find the variance between the actual vs forecast
return
if(_Variance>=0,True(),False()
\\ if _variance equal or bigger that 0, it means target has been met

 

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

Appreciate your Kudos VahidDM_0-1630589112216.png !!

VahidDM
Super User
Super User

ziyabikram96
Helper V
Helper V

you can use conditional formating background color upon threshold

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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