<?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 Data expression not returning same feature for different elements in Dashboard in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-not-returning-same-feature-for/m-p/1076806#M4763</link>
    <description>&lt;P&gt;So I am using a Data Expression for each of these elements within the dashboard.&lt;/P&gt;&lt;P&gt;The expression is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var portal = Portal("");
var fs = FeatureSetByPortalItem(
  portal,
  "",
  1,
  [
    "Date_",
    "W_F_MGD",
    "E_F_MGD",
    "TOTAL_W_E_MGD",
    "TID_FLOW_MGD",
    "REEDER_Percent_FULL",
    "TAP_FLOW_MGD",
    "PLANT_PRODUCTION_MGD"
  ],
  false
);

// Find the most recent date from the date field to filter the FeatureSet for the latest record
var maxDate = Text(Date(Max(fs,'Date_')),"YYYY-MM-DD");
return Filter(fs, "Date_ = @maxDate");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not know why the Gage has the latest information but the Indicators and pie chart are pulling from a few days ago.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RickeyFight_0-1625761484730.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17992i53FE7AB2D67753C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RickeyFight_0-1625761484730.png" alt="RickeyFight_0-1625761484730.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the result when I test the Expression:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RickeyFight_1-1625761954741.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17993i9230947B45BBAB52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RickeyFight_1-1625761954741.png" alt="RickeyFight_1-1625761954741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2021 16:34:10 GMT</pubDate>
    <dc:creator>RickeyFight</dc:creator>
    <dc:date>2021-07-08T16:34:10Z</dc:date>
    <item>
      <title>Data expression not returning same feature for different elements in Dashboard</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-not-returning-same-feature-for/m-p/1076806#M4763</link>
      <description>&lt;P&gt;So I am using a Data Expression for each of these elements within the dashboard.&lt;/P&gt;&lt;P&gt;The expression is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var portal = Portal("");
var fs = FeatureSetByPortalItem(
  portal,
  "",
  1,
  [
    "Date_",
    "W_F_MGD",
    "E_F_MGD",
    "TOTAL_W_E_MGD",
    "TID_FLOW_MGD",
    "REEDER_Percent_FULL",
    "TAP_FLOW_MGD",
    "PLANT_PRODUCTION_MGD"
  ],
  false
);

// Find the most recent date from the date field to filter the FeatureSet for the latest record
var maxDate = Text(Date(Max(fs,'Date_')),"YYYY-MM-DD");
return Filter(fs, "Date_ = @maxDate");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not know why the Gage has the latest information but the Indicators and pie chart are pulling from a few days ago.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RickeyFight_0-1625761484730.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17992i53FE7AB2D67753C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RickeyFight_0-1625761484730.png" alt="RickeyFight_0-1625761484730.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the result when I test the Expression:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RickeyFight_1-1625761954741.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17993i9230947B45BBAB52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RickeyFight_1-1625761954741.png" alt="RickeyFight_1-1625761954741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 16:34:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-not-returning-same-feature-for/m-p/1076806#M4763</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2021-07-08T16:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Data expression not returning same feature for different elements in Dashboard</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-not-returning-same-feature-for/m-p/1076811#M4766</link>
      <description>&lt;P&gt;Just to check, expand the date format to include the time. Since your timestamp is midnight, odds are it's adjusting the value for your time zone. If you were in UTC+6, then a midnight timestamp would show up as the previous date at 18:00.&lt;/P&gt;&lt;P&gt;You could use &lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#returns-date-8" target="_self"&gt;ToUTC&lt;/A&gt; to return the timestamp in the UTC value to avoid this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Text(Date(ToUTC(Max(fs,'Date_'))),"YYYY-MM-DD")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 16:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-not-returning-same-feature-for/m-p/1076811#M4766</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-07-08T16:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Data expression not returning same feature for different elements in Dashboard</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-not-returning-same-feature-for/m-p/1081945#M4834</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how to use last edit date?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was requested to add more dates past the current date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;  [
    "Date_",
    "W_F_MGD",
    "E_F_MGD",
    "TOTAL_W_E_MGD",
    "TID_FLOW_MGD",
    "REEDER_Percent_FULL",
    "TAP_FLOW_MGD",
    "PLANT_PRODUCTION_MGD",
    "last_edited_date"
  ],
  false
);


// Find the most recent date from the date field to filter the FeatureSet for the latest record
var maxDate = Text(Date(ToUTC(Max(fs, 'last_edited_date'))),"YYYY-MM-DD-HH-mm");
return Filter(fs, "last_edited_date = @maxDate");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the dashboard issue. I have our draw down past the current date but I cannot find a way to jump back and display the latest data that has been added. I thought last edit date would work but I keep getting no data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RickeyFight_0-1626984297983.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19171i8B7A8916A59CB95A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RickeyFight_0-1626984297983.png" alt="RickeyFight_0-1626984297983.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 20:06:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-not-returning-same-feature-for/m-p/1081945#M4834</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2021-07-22T20:06:02Z</dc:date>
    </item>
  </channel>
</rss>

