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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Ardydardy
Frequent Visitor

Highlight bars in a combination chart (conditional formatting of bars)

I need to highlight the bar for the latest month with a deviating colour in a combination chart.
Preferably not just the latest month but the value for that month in the past years of data being shown.

Highlighted bars.PNG

How can this be done?

1 ACCEPTED SOLUTION

I was unable to highlight the bars in the combo-diagram, but I could conditionally format the Total-labels per bar.

Ardydardy_1-1722538435810.png

 



View solution in original post

8 REPLIES 8
v-nuoc-msft
Community Support
Community Support

Hi @Ardydardy 

 

@SamWiseOwl Thank you very much for your prompt reply, please allow me to share some content here.


​As you know, there is no way to highlight it. However, you can try presenting the data in other ways, such as:

 

Create a date table, dynamically obtain the latest date, and display the same month data by selecting the date through the slicer.

 

Create a table.

 

DATE = 
CALENDAR(
    DATE(YEAR(TODAY()), MONTH(TODAY()), DAY(TODAY())), 
    DATE(YEAR(TODAY()), MONTH(TODAY()), DAY(TODAY()))
)

 

vnuocmsft_1-1722503082249.png

 

Create a slicer.

vnuocmsft_0-1722503065488.png

 

Create a measure.

 

Measure = 
var _date = MONTH(SELECTEDVALUE('DATE'[Date]))
RETURN 
IF(
    ISFILTERED('DATE'[Date]),
    CALCULATE(
        SELECTEDVALUE('Table'[value]),
        FILTER(
            'Table',
            MONTH('Table'[date]) = _date
        )
    ),
    SELECTEDVALUE('Table'[value])
)

 

Create a visual.

 

vnuocmsft_2-1722503191186.png

 

When you select a date in the slicer, visual dynamically displays the data for the same month.

 

vnuocmsft_3-1722503216576.png

 

vnuocmsft_4-1722503292640.png

 

Regards,

Nono Chen

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

 

 

I was unable to highlight the bars in the combo-diagram, but I could conditionally format the Total-labels per bar.

Ardydardy_1-1722538435810.png

 



Thank you . great idea!

I've booked this for a re-read, very cool!


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Ardydardy
Frequent Visitor

Yes, unfortunately I need to have either 2 y-axis series/columns or a legend in the combo chart.

SamWiseOwl
Memorable Member
Memorable Member

Hi @Ardydardy ,

 

Create a measure similar to this but with your column names:

Colour Measure =
IF(
    SELECTEDVALUE(Purchase[PurchaseDate].[Month]) = Format(TODAY(),"MMMM")
    ,"Yellow"
    ,"Teal"
    )
SamWiseOwl_1-1721913845395.png

 

SelectedValue lets you reference a single value in a column, in this case the name of the month column. Test that against this months value. Alternatively you could do FORMAT(MAX(Table[DateColumn]), "MMMM") to make it based on the highest value in your data.

Then go to your Columns settings and set Format Style to Field value and select this measure.
SamWiseOwl_0-1721913670659.png

If this helps please mark the answer as solved so others can find it.



If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Thanks SamWiseOwl, but is unfortunately not possible for me to choose to use a formula in the bar colour section, there is no such option:
no formula option all.PNGno formula option.PNG

Do you have something in the legend? Or two items in the column y-axis?
You can't have multiple series and conditional formatting.

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.