<?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: Calculated measures not working in Dashboards for queries with big result in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/110949#M43748</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102548"&gt;@Brahmareddy&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;This didn't work&lt;BR /&gt;&lt;SPAN&gt;count(*) * 1.0 / count(distinct field1) AS cal1)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;gave me same error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But as per this feature release&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/dashboards/datasets/calculated-measures" target="_blank"&gt;https://docs.databricks.com/aws/en/dashboards/datasets/calculated-measures&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;this should work out of box, otherwise it's not much useful.&amp;nbsp;&lt;BR /&gt;Can we check if there is an issue with this feature.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I can try to make it work by using derived columns through CTE.&amp;nbsp;&lt;BR /&gt;but just curious if the feature released supports it.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Feb 2025 06:05:11 GMT</pubDate>
    <dc:creator>797646</dc:creator>
    <dc:date>2025-02-22T06:05:11Z</dc:date>
    <item>
      <title>Calculated measures not working in Dashboards for queries with big result</title>
      <link>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/110831#M43706</link>
      <description>&lt;P&gt;Queries with big result are executed on cluster.&amp;nbsp;&lt;BR /&gt;If we specify calculated measure as something like&amp;nbsp;&lt;BR /&gt;cal1 as&lt;BR /&gt;count(*) / count(distinct field1)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;it will wrap it in backticks as&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;`count(*) / count(distinct field1) ` as `cal1`&lt;BR /&gt;&lt;BR /&gt;functions are not identified inside backticks and it fails with UNRESOLVED_COLUMN exception.&amp;nbsp;&lt;BR /&gt;It works fine if the data is small then query is executed in browser and there is no templating i guess then.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;can we please look into it or suggest the way around.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 10:26:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/110831#M43706</guid>
      <dc:creator>797646</dc:creator>
      <dc:date>2025-02-21T10:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated measures not working in Dashboards for queries with big result</title>
      <link>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/110919#M43741</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/60571"&gt;@797646&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How are you doing today? As per my understanding,&amp;nbsp;It looks like Databricks automatically wraps your calculated measure in backticks, causing function resolution issues when executing large queries on a cluster. Since it works fine for small datasets executed in the browser, the issue might be related to templating. To work around this, try explicitly casting your expression by multiplying by 1.0 (e.g., count(*) * 1.0 / count(distinct field1) AS cal1), use a CTE to define counts separately before applying the calculation, or restructure the query to define cal1 as a derived column. If using a templated query interface, try executing it in a SQL notebook instead to check if the behavior changes. Let me know if this helps!&lt;/P&gt;&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brahma&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 20:47:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/110919#M43741</guid>
      <dc:creator>Brahmareddy</dc:creator>
      <dc:date>2025-02-21T20:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated measures not working in Dashboards for queries with big result</title>
      <link>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/110949#M43748</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102548"&gt;@Brahmareddy&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;This didn't work&lt;BR /&gt;&lt;SPAN&gt;count(*) * 1.0 / count(distinct field1) AS cal1)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;gave me same error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But as per this feature release&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/dashboards/datasets/calculated-measures" target="_blank"&gt;https://docs.databricks.com/aws/en/dashboards/datasets/calculated-measures&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;this should work out of box, otherwise it's not much useful.&amp;nbsp;&lt;BR /&gt;Can we check if there is an issue with this feature.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I can try to make it work by using derived columns through CTE.&amp;nbsp;&lt;BR /&gt;but just curious if the feature released supports it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2025 06:05:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/110949#M43748</guid>
      <dc:creator>797646</dc:creator>
      <dc:date>2025-02-22T06:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated measures not working in Dashboards for queries with big result</title>
      <link>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/112298#M44170</link>
      <description>&lt;P&gt;Thanks for the tip - i tried multiplying by 1.0 but I believe it's a namespace error.&lt;/P&gt;&lt;P&gt;The error message indicates "A column with name `count(*) / count(distinct field1)` is not found."&lt;/P&gt;&lt;P&gt;After some testing, this only occurs when the distinct keyword is used.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 16:37:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/112298#M44170</guid>
      <dc:creator>AdamKleiman</dc:creator>
      <dc:date>2025-03-11T16:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated measures not working in Dashboards for queries with big result</title>
      <link>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/112772#M44321</link>
      <description>&lt;P&gt;I have the same issue.&lt;BR /&gt;calculated measures with "count(distinct x)" in them will not work!!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 07:10:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/112772#M44321</guid>
      <dc:creator>Slav</dc:creator>
      <dc:date>2025-03-17T07:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated measures not working in Dashboards for queries with big result</title>
      <link>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/112826#M44347</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;
&lt;P&gt;Could you all try with all caps? COUNT(DISTINCT xxx)&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 16:50:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/calculated-measures-not-working-in-dashboards-for-queries-with/m-p/112826#M44347</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-03-17T16:50:05Z</dc:date>
    </item>
  </channel>
</rss>

