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
nleuck_101
Resolver III
Resolver III

Different shade of color in bar chart for months not in Rolling 12?

Hello All,

 

In the image below I have a Rolling 12 ticker with totals and a bar chart that has the last 13 months. A request was asked if I could color Jan 2021 a lighter shade of purple to show that it is not included in the Rolling 12 ticker totals. I didn't believe this to be an option in Power BI, but didn't know if anyone has tried something like this before or knows of way of doing this. A thought came to mind of a slicer that would highlight only the months in the Rolling 12 but a slicer won't highlight a chart it only filters it. Any ideas would be greatly appreciated.

 

Note: This data will update next month, so the Rolling 12 will be March-2021 through Feb-2022. That means Jan-2021 will go away and Feb-2021 becomes the new month that isn't apart of the Rolling 12 and needs to be a lighter shade. This process needs to be dynamic.

Screenshot 2022-02-18 152621.png

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @nleuck_101 ,

According to your description, here's my solution.

This is my sample data, the data type of the month column Date.

vkalyjmsft_2-1645434119039.png

1.Create a calculated column Rank.

Rank = RANKX('Table','Table'[Month],,DESC,Dense)

Get the rank column based on the month.

vkalyjmsft_1-1645433964698.png

2. Create a color measure.

Color = IF(MAX('Table'[Rank])=13,"#ec8fca", "Purple")

3.Select the visual, then under the Format tab, expand Data colors, there is a fx beside the Default color, click it.

vkalyjmsft_3-1645434321628.png

Select the color measure as the based color.

vkalyjmsft_4-1645434472287.png

Get the expected result.

vkalyjmsft_5-1645434543698.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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
v-yanjiang-msft
Community Support
Community Support

Hi @nleuck_101 ,

According to your description, here's my solution.

This is my sample data, the data type of the month column Date.

vkalyjmsft_2-1645434119039.png

1.Create a calculated column Rank.

Rank = RANKX('Table','Table'[Month],,DESC,Dense)

Get the rank column based on the month.

vkalyjmsft_1-1645433964698.png

2. Create a color measure.

Color = IF(MAX('Table'[Rank])=13,"#ec8fca", "Purple")

3.Select the visual, then under the Format tab, expand Data colors, there is a fx beside the Default color, click it.

vkalyjmsft_3-1645434321628.png

Select the color measure as the based color.

vkalyjmsft_4-1645434472287.png

Get the expected result.

vkalyjmsft_5-1645434543698.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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.