Forum Discussion
Using a measure as a benchmark for table colouring
Hi,
I woud like to use a load time measure to benchmark my table numbers:
- if a number in the table is above the measure the background is red
- if a number in the table below the measure the background is green
I used this formula for creating my measure:
Avg Load Time Desktop =
CALCULATE(
AVERAGE(
'Page load time'[Avg. Page Load Time (sec)]
),
'Page load time'[Device Category]= "desktop"
)here is how the table looks:
The measure works perfectly, I just can't figure out how to set a measure as a benchmark in conditional formatting, any help is highly appreciated!
Hi, Anonymous
Maybe you need to modify your measure as below:
Avg Load Time Desktop2 = AVERAGEX ( FILTER ( ALL ( 'Page load time' ), 'Page load time'[Device Category] = "desktop" ), 'Page load time'[Page Load Time (sec)] )Then create measure "color" as below,then apply it to backgroud color conditional formating.
Color = IF(MAX('Page load time'[Page Load Time (sec)])>[Avg Load Time Desktop2],"Red","yellow green")You also can create measure as below:
Measure 2 = IF(MAX('Page load time'[Page Load Time (sec)])>[Avg Load Time Desktop2],1,0)For more details ,please check the attached pbix file and this related document.
Best Regards,
Community Support Team _ Eason
4 Replies
- v-easonf-msft
Community Support
Hi, Anonymous
Maybe you need to modify your measure as below:
Avg Load Time Desktop2 = AVERAGEX ( FILTER ( ALL ( 'Page load time' ), 'Page load time'[Device Category] = "desktop" ), 'Page load time'[Page Load Time (sec)] )Then create measure "color" as below,then apply it to backgroud color conditional formating.
Color = IF(MAX('Page load time'[Page Load Time (sec)])>[Avg Load Time Desktop2],"Red","yellow green")You also can create measure as below:
Measure 2 = IF(MAX('Page load time'[Page Load Time (sec)])>[Avg Load Time Desktop2],1,0)For more details ,please check the attached pbix file and this related document.
Best Regards,
Community Support Team _ Eason - AnonymousNot applicable
Anonymous - Conditional formatting- > BackGround Color - > It will give you options how you want to set up the formatting.
Aooreciate your kudos!! Mark this post as solution if this helps
- AnonymousNot applicable
Hi Anonymous,
I know about this function, however I can't find how to dynamically change the background colours according to the measure.
- AnonymousNot applicable
hi Anonymous -
check https://community.powerbi.com/t5/Desktop/Measure-for-colour-coding/m-p/799678 if this helps.
Appreciate your kudos!! Mark this post as solution if this helps.