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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Defaulting the stacked column chart to the maximum month

My user has requested that the stacked column chart default to highlighting the maximun month while also displaying the rest of the months in the chart. Is there a way to set a default when the report opens to highlight the maximum month in the chart without loosing the rest of the chart?

 

Thanks, Mark

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , stacked visual do not support conditional formatting with legents. I doubt you can highlight.

 

Or you can have stacked line with the line having value for the current month that might display dot on the current month

 

if(Max(Date[Month]) = format(Today(),"MMM-YYYY"), [Measure], blank())

//Use month format you are using.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for your suggestion. If the result of this this formula is the current month won't that month be the only month in the chart?

Hi @Anonymous ,

 

Have you resolved this issue? If the answer is helpful, please accept it as solution. Others will benefit from this thread. Thanks!

 

 

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

Hi @Anonymous ,

 

Please follow this to have a try:

 

A disconnected table:

Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

Measures:

Total sales =
VAR selectedsales =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER (
            'Table',
            'Table'[Date].[Month] = SELECTEDVALUE ( 'Date'[Date].[Month] )
        )
    )
RETURN
    IF (
        ISFILTERED ( 'Date'[Date].[Month] ),
        selectedsales,
        CALCULATE ( SUM ( 'Table'[Sales] ) )
    )

 

Measure =
VAR maxdate =
    MAXX ( ALL ( 'Table' ), 'Table'[Date] )
RETURN
    IF (
        ISFILTERED ( 'Date'[Date].[Month] ),
        "Blue",
        IF ( MAX ( 'Table'[Date] ) = maxdate, "Blue", "Gray" )
    )

 highlight bars by default.gif

 

You could reference the document to learn more about conditional formatting and change other colors in the formula.

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting#color-...

 

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

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors