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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Ohboy_991
Frequent Visitor

Red & green Icon (traffic ) using Conditional formatting

Hello All,

 

I need help with a Conditional Formatting.

 

I have a measure in a Matrix named as Factor. It is derived using this DAX

 Factor = ([Commited Amount] / (SUM(Tab1[OP])-SUM(Tab2[Sales Amount])))
 
I also have a slicer created using a parameter,  the slicer has values -- 2, 3 and 4
so whenever i select any value in the slicer, let say i choose 3 it should subtract the factor value and if the value is greater than or equal to the chosen value ( in this case 3 ) a green button 🟢 should come left of the data or else 🔴
Example 
Ohboy_991_1-1705064937298.png

 

Thank you for the help.

 

 
 
1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Ohboy_991   
Since you did not attach sample data for the index you calculated, I prepared a simple data set like in the picture and will demonstrate a  solution with a simple sum formula.
The table :

Ritaf1983_4-1705207211546.png

 

parameters fo slicer:

Ritaf1983_1-1705206743913.png

The measure (instead of yours):

factor_ = sum('Table'[Factor])
The measure for the conditional formatting of circles :
flag_traffic = IF([factor_]>=Selections[Selections Value],"g","r")
The modifying of conditional formatting :
 
Ritaf1983_2-1705206907598.png

 

 

The result :

Ritaf1983_5-1705207250538.png

 

pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @Ohboy_991   
Since you did not attach sample data for the index you calculated, I prepared a simple data set like in the picture and will demonstrate a  solution with a simple sum formula.
The table :

Ritaf1983_4-1705207211546.png

 

parameters fo slicer:

Ritaf1983_1-1705206743913.png

The measure (instead of yours):

factor_ = sum('Table'[Factor])
The measure for the conditional formatting of circles :
flag_traffic = IF([factor_]>=Selections[Selections Value],"g","r")
The modifying of conditional formatting :
 
Ritaf1983_2-1705206907598.png

 

 

The result :

Ritaf1983_5-1705207250538.png

 

pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.