<?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 Defining Variables in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367619#M851908</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to Dax and currently facing issues in defining variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we define table columns in Variable? Like I have a Table called Customer Master and I want to define a variable storing the customer ID. But the error is coming as Var is expecting a scalar value?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help!!&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2022 14:37:40 GMT</pubDate>
    <dc:creator>rhinorocks</dc:creator>
    <dc:date>2022-03-01T14:37:40Z</dc:date>
    <item>
      <title>Defining Variables</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367619#M851908</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to Dax and currently facing issues in defining variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we define table columns in Variable? Like I have a Table called Customer Master and I want to define a variable storing the customer ID. But the error is coming as Var is expecting a scalar value?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help!!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 14:37:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367619#M851908</guid>
      <dc:creator>rhinorocks</dc:creator>
      <dc:date>2022-03-01T14:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Variables</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367638#M851915</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="360780" data-lia-user-login="rhinorocks" class="lia-mention lia-mention-user"&gt;rhinorocks&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It depends on the logic and also on measure/column calculation you are trying to write using DAX.&lt;/P&gt;
&lt;P&gt;Check this simple blog on variables:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.purplefrogsystems.com/blog/2021/09/variables-in-dax/" target="_blank"&gt;https://www.purplefrogsystems.com/blog/2021/09/variables-in-dax/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 14:42:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367638#M851915</guid>
      <dc:creator>Pragati11</dc:creator>
      <dc:date>2022-03-01T14:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Variables</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367644#M851918</link>
      <description>&lt;P&gt;You can work with columns in DAX but your measure has to return a scalar value. For example, in the dax below I'm storing a column in a variable but returning the sum of the column. If you reply with your specific use case, we may be able to help in more detail!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;measure = 
var sales = 'sales'[sales_amount]

return sum(sales)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 14:43:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367644#M851918</guid>
      <dc:creator>Syk</dc:creator>
      <dc:date>2022-03-01T14:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Variables</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367656#M851922</link>
      <description>&lt;P&gt;Consider the following problem posted on this forum -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Days-between-two-dates-in-different-rows/m-p/2367394#M851834" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Desktop/Days-between-two-dates-in-different-rows/m-p/2367394#M851834&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I am trying to write this particular part of the code -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Days between pricelists =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;_item&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'Table'[Item]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The tellisense is not able to detect this 'Table' hence I am not being able to proceed. Check the attached picture&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;While If I write the second line of the soluation, then I am getting no error.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&amp;nbsp;_endDate&amp;nbsp;=&amp;nbsp;'Table'[ValidityEndingDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Why is this happening?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 14:56:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2367656#M851922</guid>
      <dc:creator>rhinorocks</dc:creator>
      <dc:date>2022-03-01T14:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Variables</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2370180#M852609</link>
      <description>&lt;P&gt;I think I got the solution of this issue. I was trying to write a measure instead of the calculated column.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 13:43:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2370180#M852609</guid>
      <dc:creator>rhinorocks</dc:creator>
      <dc:date>2022-03-02T13:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Variables</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2907088#M998584</link>
      <description>&lt;P&gt;Hi Syk, I build similar logic, but it doesn't work&lt;img /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="346587" data-lia-user-login="Syk" class="lia-mention lia-mention-user"&gt;Syk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;You can work with columns in DAX but your measure has to return a scalar value. For example, in the dax below I'm storing a column in a variable but returning the sum of the column. If you reply with your specific use case, we may be able to help in more detail!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;measure = 
var sales = 'sales'[sales_amount]

return sum(sales)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 16:03:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Defining-Variables/m-p/2907088#M998584</guid>
      <dc:creator>krzlag</dc:creator>
      <dc:date>2022-11-15T16:03:02Z</dc:date>
    </item>
  </channel>
</rss>

