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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Ardydardy
Advocate I
Advocate I

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
Advocate I
Advocate I

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

SamWiseOwl
Community Champion
Community Champion

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.