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
HMJSomerset
Helper II
Helper II

Data Colours assigned via a measure not displayed in Report in Power BI Service

I have a report in Power BI Desktop (May 2019) that has several visuals where the data colour is assigned via a simple measure (green if better than last year, red if worse, yellow if the same).  

This is working perfectly in desktop but when I publish up to the Service the visuals just display as one colour with no formatting.

 

What am I doing wrong?

1 ACCEPTED SOLUTION

hi, @HMJSomerset 

Adjust your formula as below:

Spend Colour KPI = 
SWITCH(
TRUE(),
[Total Spend] < [Total Spend SPLY], "#C73672",
[Total Spend] > [Total Spend SPLY], "#009CA6",
"#FFFF00"
)

For why your formula works well in power bi desktop but not works in power bi service, I have submitted it to power bi product team, I will post it here once I get a reply.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hi, @HMJSomerset 

I have tested on my side, It works well not reproduce the issue.

Could you share your simple sample pbix file for us have a test, there should be something wrong in other.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sorry - I can't share the original pbix file.  

I will have to create a new file with anonymised data if I am to share it.

I can't work out how to share the pbix file but I have uploaded screenshots of the desktop and web reports.

To reproduce the error I create two simple measures Total Spend and Total Spend SPLY

Total Spend = SUM('2018-17_MonthlyReport'[Amount])
Total Spend SPLY = CALCULATE([Total Spend],SAMEPERIODLASTYEAR(dimDate[Date]))
I then created another measure:
Spend Colour KPI =
SWITCH(
TRUE(),
[Total Spend] < [Total Spend SPLY], "C73672",
[Total Spend] > [Total Spend SPLY], "009CA6",
"FFFF00"
)
to change the colour if spend was more or less than the same period in the previous year.
I created a stacked column visual plotting Year/Month on X axis and [Total Spend] on Values
Formatting the data colours as conditional formatting
Format by Field value based on field Spend Colour KPI.
As you can see from the pictures in the desktop report the colours change, but in the service they are all the same colour
 
 

PBI DesktopPBI DesktopPBI ServicePBI Service

hi, @HMJSomerset 

Adjust your formula as below:

Spend Colour KPI = 
SWITCH(
TRUE(),
[Total Spend] < [Total Spend SPLY], "#C73672",
[Total Spend] > [Total Spend SPLY], "#009CA6",
"#FFFF00"
)

For why your formula works well in power bi desktop but not works in power bi service, I have submitted it to power bi product team, I will post it here once I get a reply.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Lin

I amended the measure to include the #hex colour and now the colours are displayed in the report in the PBI Service as well as the Desktop.

hi, @HMJSomerset 

I get this from power bi product team:

The issue here is, the measure the user has is using "C73672", "FFFF00" and "009CA6"  for the color values. Apparently chrome supports hex values like these for colors but the valid hex color format is #value. Edge does not support the values without #. 

User needs to update the measure to return "#C73672", "#FFFF00" and "#009CA6".

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors
Top Kudoed Authors