Forum Discussion
Data Label won't show on Line & Clustered Column Chart unless Legend or Column y-axis field is empty
First pic shows what my current Line and Clustered Column chart looks like, representing stock levels.
Normally i would go to Data Labels -> apply series to Annotation Point -> Detail -> Data field to "Annotation Label" and it would show my data labels. However, this seems to only work if my legend or column y-axis field is empty. (as seen below)
Is there a way to fix this? Not sure if this is a dax issue or formatting.
Below is the dax for the "annotation label" referenced in Data Labels:
Annotation Label =
VAR CurrentLabel = SELECTEDVALUE('Chart Axis'[Label])
RETURN
SWITCH(
CurrentLabel,
"April", "Order",
"August", "Replenish",
BLANK()
)
The value for line chart can't be text. We can only display numbers
However, you can add it in the label details.
3 Replies
- ryan_mayuSuper User
The value for line chart can't be text. We can only display numbers
However, you can add it in the label details.
- cengizhanarslanSuper User
When the Legend or Column y-axis is empty, each point on the visual has a single row in filter context, so SELECTEDVALUE on the axis label returns cleanly. The moment you add a Legend, each axis position now has multiple rows in context and SELECTEDVALUE returns BLANK because it can no longer resolve a single value. So I believe you could try using a measure as below if the values are same for every legend:
Annotation Label = VAR _CurrentLabel = MAX ( 'Chart Axis'[Label] ) RETURN SWITCH ( _CurrentLabel, "April", "Order", "August", "Replenish", BLANK () )- v-menakakotaCommunity Support
Hi derekli1700 ,
Thanks for reaching out to the Microsoft fabric community forum.
I would also take a moment to thank ryan_mayu , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.Best Regards,
Community Support Team