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

How to add color code whenever exception comes down in line graph

Hello Experts ,

 

How to add color code whenever exception comes down in line graph ?here in below screenshot whenver line comes down or to low line should be red color .Please advise me how to do ?any expression or dax query for this please share me it will be helpfull for me 

 

comments.JPG

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi sabih786,

As I know, we  can't set conditional format for data colors when we have legend. so one workaround is that you could try to add id in filter, and use clustered column chart at first

290.PNG

289.PNG

 

Total Sales = SUM(chart[amount])
% Change = 
VAR CurrentSales = [Total Sales]
VAR CurrentMonth = MIN(chart[year])
VAR PreviousSales = 
CALCULATE(
    [Total Sales],
    FILTER(
        ALLSELECTED(chart),
       chart[year] = CurrentMonth - 1
    )
)
RETURN
DIVIDE((CurrentSales - PreviousSales),PreviousSales)

Then switch chart to line chart, you will get result like below

 

292.PNG291.PNG

You could refer to Power BI - Line Markers with Conditional Formatting for details.

Best Regards,
Zoe Zhi

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

1 REPLY 1
dax
Community Support
Community Support

Hi sabih786,

As I know, we  can't set conditional format for data colors when we have legend. so one workaround is that you could try to add id in filter, and use clustered column chart at first

290.PNG

289.PNG

 

Total Sales = SUM(chart[amount])
% Change = 
VAR CurrentSales = [Total Sales]
VAR CurrentMonth = MIN(chart[year])
VAR PreviousSales = 
CALCULATE(
    [Total Sales],
    FILTER(
        ALLSELECTED(chart),
       chart[year] = CurrentMonth - 1
    )
)
RETURN
DIVIDE((CurrentSales - PreviousSales),PreviousSales)

Then switch chart to line chart, you will get result like below

 

292.PNG291.PNG

You could refer to Power BI - Line Markers with Conditional Formatting for details.

Best Regards,
Zoe Zhi

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.