Deneb - Dynamic title

Hello,
I was asked on a DENEB chart to add the total of the measures I have split by category in the chart as an addition to the tile.
So practically aggregate by measure and add it to the chart title…

The code comes greatly from one of the DENEB workouts - solution by Daniel Marsh-Patrick - I could re-use it almost immediately for a business case :slight_smile:

I hope it’s clear - attaching a .pbix with the example chart.
Thanks!

ex. DENEB ShowCase question Dynamic Titles.pbix (1.3 MB)

I’m sure that it can be done in Deneb using Vega-Lite, but you could also remove the title from the Vega-Lite specification and use Power BI to add the title to the Deneb visual. Just create a separate measure called “Chart Title” (or whatever you want to call it), and use Power BI’s custom formatting to assign this measure as the Deneb visual’s title. Your measure could be something like this:

Chart Title = "YTD Acutal/EOY Plan by Category (Total YTD = " & FORMAT([Spending YTD], "$#,##0,.0K") & ")"
2 Likes

Hi @valeriabreveglieri

As @DaveC said, its probably easiest to do this in Power BI directly. In Vega-Lite, you can add an expression to the title text, but it seems to need to be self-contained; AFAIK you can’t dynamically set the title text (also haven’t seen examples).

  "title": {
    "anchor": "start",
    "text": {"expr": "200 * 100"},
    "fontSize": 18,
    "fontWeight": "bold",
    "fontStyle": "italic"
  },

Hope it helps.
Greg
eDNA Forum - Deneb Dynamic Title.pbix (1.3 MB)

1 Like

This is great! I did not know you could do it this way. I see myself using this method many times over :slight_smile: .
Thanks!!!

Thank you so much Greg for the explanation and for sending back the file with the options!
Very clear. I know now how to proceed! :slight_smile:
Kind regards
Valeria