Forum Discussion
PBI Data Label not working properly
Hi everyone,
I am encountering a persistent issue regarding Dynamic Format Strings when used in conjunction with the "Total Labels" feature on a Stacked Column Chart.
The Scenario: I have a measure where I applied a Dynamic Format String to auto-scale the values (displaying "M" for millions, "K" for thousands, etc.).
Here is the DAX logic I am using for the Format String:
VAR CurrentValue = SELECTEDMEASURE()
RETURN
SWITCH( TRUE(),
ABS(CurrentValue) >= 1000000, "#,0,,.0 M", -- Format for Millions
ABS(CurrentValue) >= 1000, "#,0,.0 K", -- Format for Thousands
"#,0" -- Format for standard numbers
)The Problem: The formatting works perfectly for the individual segments within the stack. However, it fails inconsistent on the Total Labels at the top of the bars.
In some cases, even though the total sum of the stack is clearly above 1 Million (e.g., ~13 Million), the Total Label applies the nothing. As below for 2025 it should be 128M but not working properly.
I have to use this dynamic Format because my data is having wide range. As you understand from screenshot some year can be 150x times higher than others. If I use auto scale then I'm unable to see low values and i need to increase decimal values and it causes overlapping in the chart
Here it is an example for auto scale usage. I'm having lots of 0M values which tells meaningless words for me.
any idea/comment on that ?
Hi als_pbi_1325
This is a known Power BI issue: Dynamic Format Strings don’t reliably work with Total Labels in stacked column charts.Don’t use default Total Labels.
Create a separate measure for the total and display it via:
A line on a combo chart, or
A card/tooltip.
Use FORMAT() to return text with M/K (e.g., "0.0 M"), but note that values become text.
Try these solutions and let me know if you need further clarificationRegards,
Rufyda Rahma | MIE
3 Replies
- RufydaSuper User
Hi als_pbi_1325
This is a known Power BI issue: Dynamic Format Strings don’t reliably work with Total Labels in stacked column charts.Don’t use default Total Labels.
Create a separate measure for the total and display it via:
A line on a combo chart, or
A card/tooltip.
Use FORMAT() to return text with M/K (e.g., "0.0 M"), but note that values become text.
Try these solutions and let me know if you need further clarificationRegards,
Rufyda Rahma | MIE - v-karpurapudCommunity Support
Hi als_pbi_1325
Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to Rufyda for sharing solution.Could you please confirm if your query has been resolved by the provided solution?If you have any more questions, please let us know and we’ll be happy to help.
Regards,
Microsoft Fabric Community Support Team
- v-karpurapudCommunity Support
Hi als_pbi_1325
We have not received a response from you regarding the query and were following up to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank You.