<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Making Deneb dynamic in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3872173#M9548</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Replace line 13 with the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "name": "percent",
  "update": "data('dataset')[0]['_Percentage']"
}&lt;/LI-CODE&gt;
&lt;P&gt;This requests the value of the _Percentage measure in the first row of the dataset that Deneb creates.&lt;BR /&gt;Ref: &lt;A href="https://vega.github.io/vega/docs/expressions/#data" target="_self"&gt;Vega &lt;FONT face="courier new,courier"&gt;data()&lt;/FONT&gt; function&lt;/A&gt;&lt;BR /&gt;Ref: &lt;A href="https://deneb-viz.github.io/dataset" target="_self"&gt;how Deneb assigns the internal dataset&lt;/A&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Sat, 27 Apr 2024 09:24:50 GMT</pubDate>
    <dc:creator>dm-p</dc:creator>
    <dc:date>2024-04-27T09:24:50Z</dc:date>
    <item>
      <title>Making Deneb dynamic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3868614#M9539</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I found a really nice Deneb visual online. However, this visual is using a static number. I want to connect it with my measure, named _Percentage. I thought I needed to replace "85" with my measure (at row 13), but it wasn't so simple. How can the measure by added, so that it responds dynamically? The Deneb code is as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"$schema": "&lt;A href="https://vega.github.io/schema/vega/v5.json" target="_blank"&gt;https://vega.github.io/schema/vega/v5.json&lt;/A&gt;",&lt;BR /&gt;"width": 400,&lt;BR /&gt;"height": 400,&lt;BR /&gt;"padding": 50,&lt;BR /&gt;"background": "#222431",&lt;BR /&gt;"signals": [&lt;BR /&gt;{&lt;BR /&gt;"name": "textGradient",&lt;BR /&gt;"update": "{gradient: 'linear', stops: [{offset: 0, color: '#14d8cc'}, {offset: 1, color: '#4c8bee'}]}"&lt;BR /&gt;},&lt;BR /&gt;&lt;BR /&gt;{"name": "percent", "update": "85"}],&lt;BR /&gt;"data": [&lt;BR /&gt;{&lt;BR /&gt;"name": "back",&lt;BR /&gt;"values": [],&lt;BR /&gt;"transform": [&lt;BR /&gt;{"type": "sequence", "start": 0, "stop": 100, "step": 1, "as": "val"},&lt;BR /&gt;{"type": "formula", "expr": "1", "as": "t"},&lt;BR /&gt;{&lt;BR /&gt;"type": "pie",&lt;BR /&gt;"field": "t",&lt;BR /&gt;"startAngle": {"signal": "0"},&lt;BR /&gt;"endAngle": {"signal": "2*PI"}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "front",&lt;BR /&gt;"values": [],&lt;BR /&gt;"transform": [&lt;BR /&gt;{&lt;BR /&gt;"type": "sequence",&lt;BR /&gt;"start": 0,&lt;BR /&gt;"stop": {"signal": "percent"},&lt;BR /&gt;"step": 1,&lt;BR /&gt;"as": "val"&lt;BR /&gt;},&lt;BR /&gt;{"type": "formula", "expr": "1", "as": "t"},&lt;BR /&gt;{&lt;BR /&gt;"type": "pie",&lt;BR /&gt;"field": "t",&lt;BR /&gt;"startAngle": {"signal": "0"},&lt;BR /&gt;"endAngle": {"signal": "((2*PI)/100)*percent"}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"scales": [&lt;BR /&gt;{&lt;BR /&gt;"name": "color",&lt;BR /&gt;"type": "linear",&lt;BR /&gt;"domain": {"data": "back", "field": "val"},&lt;BR /&gt;"range": ["#14d8cc", "#4c8bee", "#6567ee", "#b533d2","#b533d2"]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"marks": [&lt;BR /&gt;{&lt;BR /&gt;"type": "arc",&lt;BR /&gt;"from": {"data": "back"},&lt;BR /&gt;"encode": {&lt;BR /&gt;"enter": {&lt;BR /&gt;"fill": {"value": "#3f424e"},&lt;BR /&gt;"x": {"signal": "width / 2"},&lt;BR /&gt;"y": {"signal": "height / 2"}&lt;BR /&gt;},&lt;BR /&gt;"update": {&lt;BR /&gt;"startAngle": {"field": "startAngle"},&lt;BR /&gt;"endAngle": {"field": "endAngle"},&lt;BR /&gt;"padAngle": {"signal": "0.015"},&lt;BR /&gt;"innerRadius": {"signal": "(width / 2)-15"},&lt;BR /&gt;"outerRadius": {"signal": "width / 2"}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"type": "arc",&lt;BR /&gt;"from": {"data": "front"},&lt;BR /&gt;"encode": {&lt;BR /&gt;"enter": {&lt;BR /&gt;"fill": {"scale": "color", "field": "val"},&lt;BR /&gt;"x": {"signal": "width / 2"},&lt;BR /&gt;"y": {"signal": "height / 2"}&lt;BR /&gt;},&lt;BR /&gt;"update": {&lt;BR /&gt;"startAngle": {"field": "startAngle"},&lt;BR /&gt;"endAngle": {"field": "endAngle"},&lt;BR /&gt;"padAngle": {"signal": "0.015"},&lt;BR /&gt;"innerRadius": {"signal": "(width / 2)-15"},&lt;BR /&gt;"outerRadius": {"signal": "width / 2"}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"type": "arc",&lt;BR /&gt;"data": [{"a": 1}],&lt;BR /&gt;"encode": {&lt;BR /&gt;"enter": {&lt;BR /&gt;"fill": {"value": "#3f424e"},&lt;BR /&gt;"x": {"signal": "width / 2"},&lt;BR /&gt;"y": {"signal": "height / 2"}&lt;BR /&gt;},&lt;BR /&gt;"update": {&lt;BR /&gt;"startAngle": {"signal": "0"},&lt;BR /&gt;"endAngle": {"signal": "2*PI"},&lt;BR /&gt;"innerRadius": {"signal": "(width / 2)-25"},&lt;BR /&gt;"outerRadius": {"signal": "(width / 2)-20"}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"type": "text",&lt;BR /&gt;"data": [{}],&lt;BR /&gt;"encode": {&lt;BR /&gt;"update": {&lt;BR /&gt;"text": {"signal": "percent + '%'"},&lt;BR /&gt;"align": {"value": "center"},&lt;BR /&gt;"fontWeight": {"value": "bold"},&lt;BR /&gt;"fill": {"signal": "textGradient"},&lt;BR /&gt;"x": {"signal": "width /2"},&lt;BR /&gt;"y": {"signal": "width /2"},&lt;BR /&gt;"dy": {"value":10},&lt;BR /&gt;"fontSize": {"value": 70}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;,&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"type": "text",&lt;BR /&gt;"data": [{}],&lt;BR /&gt;"encode": {&lt;BR /&gt;"update": {&lt;BR /&gt;"text": {"value": "on target"},&lt;BR /&gt;"align": {"value": "center"},&lt;BR /&gt;"fontWeight": {"value": "bold"},&lt;BR /&gt;"fill": {&lt;BR /&gt;"value": "#9092a1" },&lt;BR /&gt;"x": {"signal": "width /2"},&lt;BR /&gt;"y": {"signal": "width /2"},&lt;BR /&gt;"dy": {"value":40},&lt;BR /&gt;"fontSize": {"value": 30}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;]&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 13:57:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3868614#M9539</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-25T13:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Making Deneb dynamic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3870977#M9540</link>
      <description>&lt;P&gt;to get your data from Power BI you need to use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"data": {"name": "dataset"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 11:42:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3870977#M9540</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-26T11:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Making Deneb dynamic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3872173#M9548</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Replace line 13 with the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "name": "percent",
  "update": "data('dataset')[0]['_Percentage']"
}&lt;/LI-CODE&gt;
&lt;P&gt;This requests the value of the _Percentage measure in the first row of the dataset that Deneb creates.&lt;BR /&gt;Ref: &lt;A href="https://vega.github.io/vega/docs/expressions/#data" target="_self"&gt;Vega &lt;FONT face="courier new,courier"&gt;data()&lt;/FONT&gt; function&lt;/A&gt;&lt;BR /&gt;Ref: &lt;A href="https://deneb-viz.github.io/dataset" target="_self"&gt;how Deneb assigns the internal dataset&lt;/A&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 09:24:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3872173#M9548</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2024-04-27T09:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Making Deneb dynamic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3883055#M9576</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/397"&gt;@dm-p&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your replies! I tried to implement the steps, in several ways. I didn't get it to work unfortunately.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sample data is simple, because I created some dummy data.&lt;/P&gt;&lt;P&gt;I have a table with a column called Percentage. It has the following data (see below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure, which I added to the Deneb visual is&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_Percentage =&lt;/SPAN&gt; &lt;SPAN&gt;AVERAGE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Percentage&lt;/SPAN&gt;&lt;SPAN&gt;[Percentage]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I hope you guys can help me further! I really want this visual to work.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;0,01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0,1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0,25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0,5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0,75&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0,99&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 01 May 2024 15:13:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3883055#M9576</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-01T15:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Making Deneb dynamic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3884763#M9582</link>
      <description>&lt;P&gt;I added the data to the model and set it as a percentage type. The same with the measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The key thing is that percentages will be added to a Deneb visual as a decimal value, so to make this work with the template, you will need to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Modify my suggestion to multiply by 100 to get a number between 1 and 100 rather than 0 and 1, e.g.:&lt;BR /&gt;
&lt;PRE&gt;{&lt;BR /&gt;    "name": "percent",&lt;BR /&gt;    "update": "data('dataset')[0]['_Percentage'] * 100"&lt;BR /&gt;}​&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Because this might result in a floating point value with many decimal places, modify the text mark's text property to use a format function call to fix it to 2 decimal places, e.g.: &lt;BR /&gt;
&lt;PRE&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "type": "text",&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"data": [{}],&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"encode": {&lt;BR /&gt;        "update": {&lt;BR /&gt;            "text": {&lt;BR /&gt;                "signal": "format(percent, '.2f') + '%'"&lt;BR /&gt;            },&lt;BR /&gt;            ...&lt;BR /&gt;        }​&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Note that these are minimal changes against the original template. If you have a format string against your model, you could probably use the technique in step 1 to get the &lt;FONT face="courier new,courier"&gt;_Percentage__format&lt;/FONT&gt; field that Deneb creates for measures into an additional signal and substitute that into step 2 rather than do the formating work manually, or use the &lt;A href="https://deneb-viz.github.io/formatting#pbiformat-expression-function-full-implementation-details" target="_self"&gt;pbiFormat function in Deneb&lt;/A&gt; to use a Power BI format string. However the above approach will work as you intend it to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dmp_1-1714626804700.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1090103iC512388AD2FE6884/image-size/large?v=v2&amp;amp;px=999" role="button" title="dmp_1-1714626804700.png" alt="dmp_1-1714626804700.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've added this to a report and attached it so you can confirm it works and investigate the solution yourself. Changes are on lines &lt;STRONG&gt;14&lt;/STRONG&gt; and &lt;STRONG&gt;175&lt;/STRONG&gt; of the specification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 05:19:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3884763#M9582</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2024-05-02T05:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Making Deneb dynamic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3885018#M9583</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/397"&gt;@dm-p&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you so much!! I really appreciate your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 06:34:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Making-Deneb-dynamic/m-p/3885018#M9583</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-02T06:34:26Z</dc:date>
    </item>
  </channel>
</rss>

