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
Anonymous
Not applicable

conditional format line chart

Hi 

 

Just wondering how one would go about coloring line chart for example in my graph below we did worst this week compared to last week it should be red and when we do better it should be green. Most tutorial show use of legend but I want to colour one of the lines and the whole line not just parts of the line that don't meet the condition.

 

EXAMPLE:

Bad week

Capture.PNG

 

Good week

Capture2.PNG

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @Anonymous 

you would want to create a measure for week category

Example Good Week = IF(GoodWEEK, Green, Red)

 

then use the measure in the conditional format of your Graph

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

3 REPLIES 3
v-xulin-mstf
Community Support
Community Support

Hi  @Anonymous ,

It is a great pity that conditional formatting applies only to the values of Table or Matrix visuals, and doesn't apply to any subtotals, grand totals, or the Total row.

Please refer this document about conditional format :Considerations and limitations of conditional format

If you want to apply to Line Chart, as far as I know, it is not supported yet currently. We also not found an effective solution to meet your requirement.

 

Perhaps you can submit the requirement to ideas and add your comments there to make this feature coming sooner: https://ideas.powerbi.com/forums/265200-power-bi-ideas.

It is a place for customers provide feedback about Microsoft Office products.

In additional, you can also vote for this need: https://ideas.powerbi.com/ideas/idea/?ideaid=4d30fed8-4890-46ad-aec3-1b65a6724d9b.

If a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,

Link Chen

 

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

aj1973
Community Champion
Community Champion

Hi @Anonymous 

you would want to create a measure for week category

Example Good Week = IF(GoodWEEK, Green, Red)

 

then use the measure in the conditional format of your Graph

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

amitchandak
Super User
Super User

@Anonymous , conditional formatting is only possible when you use one measure(value) and no legend. That too you need to do it in bar visual and make it as line visual with marker.

 

If above is true create a color measure and use that in conditional formatting with Field value option

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")

 

refer :

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

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.