<?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: Arcade statement directly in a dashboard? in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627474#M11249</link>
    <description>&lt;P&gt;Bingo! Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;! I was speeding through that step so fast that I missed it completely.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jun 2025 19:50:25 GMT</pubDate>
    <dc:creator>AmyRoust</dc:creator>
    <dc:date>2025-06-26T19:50:25Z</dc:date>
    <item>
      <title>Arcade statement directly in a dashboard?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627441#M11245</link>
      <description>&lt;P&gt;Is it possible to use Arcade inside an element on a dashboard? Or do I need to do the math in a web map and then refer to that field?&lt;/P&gt;&lt;P&gt;Here's what I'm trying to do (fake data for illustration):&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;Fed Source 1&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;Fed Source 2&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;Local Source 1&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;Local Source 2&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;Local Source 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;$999&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$999&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$444&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$444&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$444&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;$523&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$231&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$123&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$153&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$9751&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;$6237&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$94086&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$0&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$0&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;$0&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$0&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$992&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$1000&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;$904&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a donut chart that shows the percentage of federal funding versus local funding. My thought was that I could write an Arcade statement to add up Fed Source 1 and Fed Source 2 and call it FED, then write an Arcade statement to add up Local Source 1, Local Source 2, and Local Source 3 and call it LOCAL. I'm not seeing any place inside Dashboards where I can do statements like this, but I thought I'd ask to be certain.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 18:59:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627441#M11245</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2025-06-26T18:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade statement directly in a dashboard?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627454#M11246</link>
      <description>&lt;P&gt;You can do this with a &lt;A href="https://doc.arcgis.com/en/dashboards/latest/get-started/create-data-expressions.htm" target="_self"&gt;data expression&lt;/A&gt; that would supply a FeatureSet to the chart. In the data expression, you would fetch the data set and use the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#sum" target="_self"&gt;Sum&lt;/A&gt; function expression for each field and add them up. Then you would put those values into a new FeatureSet (since a data expression needs to return a FeatureSet).&lt;/P&gt;&lt;P&gt;That would look something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Fetches features from a public portal item
var fs = FeatureSetByPortalItem(
  Portal("yourPortal"),
  "yourItem",
  0,
  ["Fed1", "Fed2", "Local1", "Local2", "Local3"],
  false
);

var fed = Round(Sum(fs, "Fed1") + Sum(fs, "Fed2"), 2);
var local = Round(Sum(fs, "Local1") + Sum(fs, "Local2") + Sum(fs, "Local3"), 2);

return FeatureSet(
  {
    fields: [
      { name: "Federal", type: "esriFieldTypeSingle" },
      { name: "Local", type: "esriFieldTypeSingle" }
    ],
    features: [{
      attributes: {Federal: fed, Local: local}
    }]
  }
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 19:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627454#M11246</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-06-26T19:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade statement directly in a dashboard?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627456#M11247</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;. The code isn't my issue - my question is: is there a place in ArcGIS Dashboards where I can write code? Or do I have to write it in a web map and then use the web map in the dashboard?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 19:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627456#M11247</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2025-06-26T19:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade statement directly in a dashboard?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627466#M11248</link>
      <description>&lt;P&gt;When you add an element to the dashboard, you have the choice of selecting a layer or a data expression. If it's an empty dashboard, you'll be present with this dialog&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_1a531ce.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/135238i41AC7DF55F6D902B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_1a531ce.png" alt="Snag_1a531ce.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you're using an existing dashboard, you'll see something like this dialog&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_1a7a232.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/135239i1EB8DEC0E9B6042B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_1a7a232.png" alt="Snag_1a7a232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In either case, click "New data expression" to add your Arcade code.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 19:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627466#M11248</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-06-26T19:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade statement directly in a dashboard?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627474#M11249</link>
      <description>&lt;P&gt;Bingo! Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;! I was speeding through that step so fast that I missed it completely.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 19:50:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-statement-directly-in-a-dashboard/m-p/1627474#M11249</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2025-06-26T19:50:25Z</dc:date>
    </item>
  </channel>
</rss>

