Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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?
Solved! Go to Solution.
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
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
@bml123 ,
You need to create an absolute measure
M1 = abs([measure])
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 39 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |