Text Offset in Stacked Bar Plot

Hello,

I have a stacked bar plot with a year facet that I posted previously before. I have done a few changes after I posted it here. There is a minor change I am looking to do but I am not able yet to get my head around it. On top of the stacked bar there is a percentage calculated between each bar in the yearly facet. The percentage in some cases is overlayed on top of the bar as in the picture below because the yOffset is always set from the end of the lower stacked-bar which in this case in P (Example of year 2024) How can I fix this? Thanks a lot

Here is the pbix file.
Test.pbix (1.5 MB)

Hi @AndrewRizk

The Y offset is applied not to the lower value for the year, but rather to the last value for the year; I changed the data for P for 2025 to check.

If you want to apply it rather to the maximum value for the year, you’ll need to calculate it and use it as the Y encoding for the text mark in question.

Hope this helps.
Greg
eDNA Forum - Deneb Text Offset in Faceted Bar Chart.pbix (1.5 MB)

1 Like

@Greg That’s it, Thanks a lot Greg!!!