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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors