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
IPGeorgiev
Helper III
Helper III

Measure based on Column

Hi,

 

I have the following issue:

 

I have  a matrix which looks like this:

 

image.png

 

So the types here are the types of communication - Written or Voice.

 

So I will have a KPI1% under the two availible columns "Written" and "Voice"

 

I want to add coniditional formatting for KPI1% based on the targets that I have - however! the targets are different for the different communication types. So I cant have both as applying the targets for written for example will mean that the same conditional formatting will be added under "Voice" column as well.

 

1. Is it possible to have different conditional formatting based on the column value?

 

2. I guess 1) is not possible therefore I have tried to use quick measures.

 

I click right button KPI1% and select quick measure then I add a filter to be , for example, type="Written". This adds a new measure KPI1% for Written - this works as expected, HOWEVER I know have this value "KPI1% for Written" two times - under column "Written" and under Column "Voice" - is it possible to have this ONLY under the "Written" column?

 

Many thanks in advance!


Best regards,
Ivan

1 ACCEPTED SOLUTION

Right, so thinking of a measure like:

Measure?
VAR __Type to MAX('Table'[Type])
VAR __RedThreshold - IF(__Type to "Written",.75,.85)
VAR __KPI1 [KPI1%]
Return
IF(__KPI1 <-__RedThreshold,"Red","Green")

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

You *should* be able to create a new measure that does the coding based upon the Type. You would then use this new measure for your rules. But, impossible to be specific because there are large gaps in required information like what are the rules that you are trying to implement for the color coding?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

many thanks for the response!

 

Here  more information:

 

KPI1% is between 0% and 100%.

 

If the type is Written:

 

Values between 0% and 75% should be colored (background) in red.

Values between 75.01% and 100% should have green background 

 

If the type is Voice:

 

Values between 0% and 85% should be colored (background) in red.

Values between 85.01% and 100% should have green background 

 

Many thanks in advance!!

Right, so thinking of a measure like:

Measure?
VAR __Type to MAX('Table'[Type])
VAR __RedThreshold - IF(__Type to "Written",.75,.85)
VAR __KPI1 [KPI1%]
Return
IF(__KPI1 <-__RedThreshold,"Red","Green")

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

you are just awesome!!

Thank you very much - it works!

Do you have an idea of what it would look like (the formula) if you have 3 channels - Voice, Written, Chat?

Awesome! Glad it works!! 🙂

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.