<?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: Created a table as a variable in a measure. Filtering by one column doesn't change the results. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Created-a-table-as-a-variable-in-a-measure-Filtering-by-one/m-p/4030784#M159392</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="547917" data-lia-user-login="Singularity9" class="lia-mention lia-mention-user"&gt;Singularity9&lt;/a&gt;&amp;nbsp;, and thank you for sharing a question with the Community.&amp;nbsp; &amp;nbsp;This reply is informational.&amp;nbsp; &amp;nbsp;Please&amp;nbsp;remember to adhere to the decorum of the Community Forum when asking a question.&lt;BR /&gt;&lt;BR /&gt;Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="color: darkblue;"&gt;&lt;EM&gt;If your requirement is solved, please make THIS ANSWER a SOLUTION &lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;EM&gt; and help other users find the solution quickly. Please hit the LIKE &lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;EM&gt; button if this comment helps you.&amp;nbsp; Proud to be a Super User!&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 16:44:16 GMT</pubDate>
    <dc:creator>foodd</dc:creator>
    <dc:date>2024-07-08T16:44:16Z</dc:date>
    <item>
      <title>Created a table as a variable in a measure. Filtering by one column doesn't change the results.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Created-a-table-as-a-variable-in-a-measure-Filtering-by-one/m-p/4030759#M159391</link>
      <description>&lt;P&gt;I've created a measure. It's using a table, table1. In this table I have created a table test12 as a variable, like so:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;var test1 = SUMMARIZE(&lt;/DIV&gt;&lt;DIV&gt;CALCULATETABLE(&lt;/DIV&gt;&lt;DIV&gt;Table1,&lt;/DIV&gt;&lt;DIV&gt;Table1[Value1]="A"&lt;/DIV&gt;&lt;DIV&gt;&amp;amp;&amp;amp;Table1[Area]&amp;lt;&amp;gt;"Area1"&lt;/DIV&gt;&lt;DIV&gt;&amp;amp;&amp;amp;Table1[Area]&amp;lt;&amp;gt;"Area2"&lt;/DIV&gt;&lt;DIV&gt;"), Table1[Area]&lt;/DIV&gt;&lt;DIV&gt;)&lt;BR /&gt;var test12 =&lt;/DIV&gt;&lt;DIV&gt;ADDCOLUMNS(&lt;/DIV&gt;&lt;DIV&gt;test1,&lt;/DIV&gt;&lt;DIV&gt;"lastmonth",&lt;/DIV&gt;&lt;DIV&gt;calculate([Last Month Total],Table1[Value2]="B"),&lt;/DIV&gt;&lt;DIV&gt;"prevmonth",&lt;/DIV&gt;&lt;DIV&gt;calculate([Previous Month Total],Table1[Value2]="B"),&lt;/DIV&gt;&lt;DIV&gt;"Difference",&lt;/DIV&gt;&lt;DIV&gt;calculate([Last Month Total],Table1[Value2]="B")-calculate([Previous Month Total],Table1[Value2]="B"),&lt;/DIV&gt;&lt;DIV&gt;"Percentage",&lt;/DIV&gt;&lt;DIV&gt;divide(&lt;/DIV&gt;&lt;DIV&gt;calculate([Last Month Total],Table1[Value2]="B")&lt;/DIV&gt;&lt;DIV&gt;-&lt;/DIV&gt;&lt;DIV&gt;calculate([Previous Month Total],Table1[Value2]="B"),&lt;/DIV&gt;&lt;DIV&gt;calculate([Previous Month Total],Table1[Value2]="B")))&lt;BR /&gt;&lt;BR /&gt;Apologies, I know my code could use a cleanup. I'm trying to return values from the table test12, filtered by other values in test12. But filters don't seem to work at all. For example, when I ask it to return,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;countrows(test12)&amp;amp; " "&amp;amp;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;countrows&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;test12&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;test12&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Percentage]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;1000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;[prevmonth]&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;[lastmonth]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;It returns two values separated by a space, one which is the correct number of rows I'm expecting in table 12 (i.e., the total number of distinct areas) and one which is&amp;nbsp;&lt;EM&gt;exactly the same as the first.&amp;nbsp;&lt;/EM&gt;The filters don't have any effect. The percentage is not over 1000 for any of the values in test12, I just used that as an example to confirm that the filter wasn't doing anything. Can anyone help? Thank you in advance.&lt;/DIV&gt;</description>
      <pubDate>Tue, 09 Jul 2024 12:34:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Created-a-table-as-a-variable-in-a-measure-Filtering-by-one/m-p/4030759#M159391</guid>
      <dc:creator>Singularity9</dc:creator>
      <dc:date>2024-07-09T12:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Created a table as a variable in a measure. Filtering by one column doesn't change the results.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Created-a-table-as-a-variable-in-a-measure-Filtering-by-one/m-p/4030784#M159392</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="547917" data-lia-user-login="Singularity9" class="lia-mention lia-mention-user"&gt;Singularity9&lt;/a&gt;&amp;nbsp;, and thank you for sharing a question with the Community.&amp;nbsp; &amp;nbsp;This reply is informational.&amp;nbsp; &amp;nbsp;Please&amp;nbsp;remember to adhere to the decorum of the Community Forum when asking a question.&lt;BR /&gt;&lt;BR /&gt;Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="color: darkblue;"&gt;&lt;EM&gt;If your requirement is solved, please make THIS ANSWER a SOLUTION &lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;EM&gt; and help other users find the solution quickly. Please hit the LIKE &lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;EM&gt; button if this comment helps you.&amp;nbsp; Proud to be a Super User!&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 16:44:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Created-a-table-as-a-variable-in-a-measure-Filtering-by-one/m-p/4030784#M159392</guid>
      <dc:creator>foodd</dc:creator>
      <dc:date>2024-07-08T16:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Created a table as a variable in a measure. Filtering by one column doesn't change the results.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Created-a-table-as-a-variable-in-a-measure-Filtering-by-one/m-p/4043467#M160369</link>
      <description>&lt;P&gt;Hi,&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="547917" data-lia-user-login="Singularity9" class="lia-mention lia-mention-user"&gt;Singularity9&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Has the problem been solved? If it does, share your solution and accept it as a solution that will help other community members who have the same problem as you.&lt;/P&gt;
&lt;P&gt;If not, I would appreciate it if you could provide me with a PBIX file or sample data. When uploading a pbix file, delete sensitive data and don't sign in to your account in Power BI Desktop. It is recommended to use SharePoint or Onedrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Leroy Lu&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 04:27:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Created-a-table-as-a-variable-in-a-measure-Filtering-by-one/m-p/4043467#M160369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-16T04:27:20Z</dc:date>
    </item>
  </channel>
</rss>

