Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
johnny149628
New Member

Reset Color Order for Visible Lines

I am working with a line plot, where for instance I would like to plot the earnings of an employee. We have many stores and many employees, so I filter down by store name and then employee. The issue is, if I select a single employee (Store Number N, Employee X), it will choose a different color depending on which this is.

 

Instead, I would like the first employee shown to be blue, the second to be red, etc. Basically, reset the color order based on the series actually being depicted.

 

Is there way to accomplish this?

2 REPLIES 2
johnny149628
New Member

I don't believe this works for a couple reasons. 1) conditional formatting is not available for line plots 2)once I add a legend (for a column chart) conditional formatting is no longer available.

 

The legend applies the colors currently, so maybe I could re-word the question:

 

If I am setting distinct lines by legend, is there a way to order the colors based on the order in the legend. For example, if my legend has 5 entries, regardless of what the store and employee are, make the first entry colored blue, the second colored red, etc.

v-yadongf-msft
Community Support
Community Support

Hi @johnny149628 ,

 

I think conditional formatting is more suitable for you.

 

This is my test table:

vyadongfmsft_0-1665642475512.png

 

Create a new column:

Color = 
var employee_rank = RANKX(FILTER('Table','Table'[Store number] = EARLIER('Table'[Store number])),'Table'[Employee],,ASC,Dense)
return
SWITCH(
    TRUE(),
    employee_rank = 1,"deep sky blue",
    employee_rank = 2,"hot pink",
    employee_rank = 3,"lightgreen"
)

vyadongfmsft_1-1665642640668.png

 

Create a table visual and right click, select conditional formatting - background color.

vyadongfmsft_3-1665643286787.png

 

Field value - Color

vyadongfmsft_4-1665643479335.png

 

You will get a table like this:

vyadongfmsft_5-1665643547370.png

 

 

The result you want after filtering:

vyadongfmsft_6-1665643645120.png

 

Best regards,

Yadong Fang

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.