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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
bml123
Post Patron
Post Patron

Negative value not appearing in stacked bar chart, want to show negative as positive at the top

Hi,

 

I have a stacked column chart with totals and the variance.  If there is a negative value, it's not showing up in the stacked column chart as below.   I want to show the negative amount as positive at the top.  How do I achieve that?

 

bml123_0-1656671463093.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bml123,

Did you mean to summary your records based on value symbol(positive/negative) and display them with positive value?

If that is the case, you can create a table with positive, and negative strings and use new table field on chart legends.

After these steps, you can write a measure fromula with a variable to aggregate value and return different results based on current category values.

formula =
VAR currType =
    SELECTEDVALUE ( NewTable[Type] ) //positive, negative 
RETURN
    SWITCH (
        currType,
        "positive",
            CALCULATE (
                SUM ( Table[Sales] ),
                FILTER ( ALLSELECTED ( Table ), [Sales] > 0 ),
                VALUES ( Table[Category] )
            ),
        "negative",
            CALCULATE (
                ABS ( SUM ( Table[Sales] ) ),
                FILTER ( ALLSELECTED ( Table ), [Sales] < 0 ),
                VALUES ( Table[Category] )
            )
    )

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @bml123,

Did you mean to summary your records based on value symbol(positive/negative) and display them with positive value?

If that is the case, you can create a table with positive, and negative strings and use new table field on chart legends.

After these steps, you can write a measure fromula with a variable to aggregate value and return different results based on current category values.

formula =
VAR currType =
    SELECTEDVALUE ( NewTable[Type] ) //positive, negative 
RETURN
    SWITCH (
        currType,
        "positive",
            CALCULATE (
                SUM ( Table[Sales] ),
                FILTER ( ALLSELECTED ( Table ), [Sales] > 0 ),
                VALUES ( Table[Category] )
            ),
        "negative",
            CALCULATE (
                ABS ( SUM ( Table[Sales] ) ),
                FILTER ( ALLSELECTED ( Table ), [Sales] < 0 ),
                VALUES ( Table[Category] )
            )
    )

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@bml123 ,

You need to create an absolute measure

 

M1  = abs([measure])



New Power BI Features
Datamarts: https://youtu.be/8tskWsJTEpg
Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.