<?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: Refering to Another Measure is giving blank in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Refering-to-Another-Measure-is-giving-blank/m-p/3165872#M113854</link>
    <description>&lt;P&gt;I found a solution for that but don't know if this is the optimum one or no, change the measure to&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Previous Month Measure =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(Fact_Sales[Month_ID]),&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;STRONG&gt;ALL(Fact_Sales)&lt;/STRONG&gt;, Fact_Sales[Last Month]=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 12:54:46 GMT</pubDate>
    <dc:creator>john_elmasry</dc:creator>
    <dc:date>2023-03-31T12:54:46Z</dc:date>
    <item>
      <title>Refering to Another Measure is giving blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Refering-to-Another-Measure-is-giving-blank/m-p/3165763#M113850</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have only one table with these columns.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last month column is a flag refers to the latest month in the fact table and it is generated in the sql query itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the dashboard I want to calculate the values of the Previous month to last month which is for example 202304 .. and I don't want to add any time slicer, I want all to happen through measures, I also don't need a date column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any way I created a measure to get the Previous Month ID which is 202304 .. the measure is as follow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Previous Month Measure = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(Fact_Sales[Month_ID]),&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(Fact_Sales, Fact_Sales[Last Month]=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I created another measure to calculate the sales volume based on this Previous Month ID, As follows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Volume (MT) LY = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(Fact_Sales[SALES]), &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(Fact_Sales, Fact_Sales[Month_ID] = [Previous Month Measure]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;The result is BLANK()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, when I add the Previous Month Definition inside the second measure as a parameter, it works perfectly.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Volume (MT) LY = &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;PREVIOUS_MONTH_VARIABLE&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;min&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Fact_Sales&lt;/SPAN&gt;&lt;SPAN&gt;[Month_ID]&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;1&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;Fact_Sales&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Fact_Sales&lt;/SPAN&gt;&lt;SPAN&gt;[Last Month]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Fact_Sales&lt;/SPAN&gt;&lt;SPAN&gt;[SALES]&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;Fact_Sales&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Fact_Sales&lt;/SPAN&gt;&lt;SPAN&gt;[Month_ID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;PREVIOUS_MONTH_VARIABLE&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I need to understand why the first method is not working, also if I wanted to use the first method as splitting it to 2 measures, what should I do?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Kindly find a demo in the url.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://drive.google.com/file/d/1M3y_cmFKgP2gFAiT-IQUt09n9Mt9KiEJ/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1M3y_cmFKgP2gFAiT-IQUt09n9Mt9KiEJ/view?usp=sharing&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 12:23:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Refering-to-Another-Measure-is-giving-blank/m-p/3165763#M113850</guid>
      <dc:creator>john_elmasry</dc:creator>
      <dc:date>2023-03-31T12:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Refering to Another Measure is giving blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Refering-to-Another-Measure-is-giving-blank/m-p/3165872#M113854</link>
      <description>&lt;P&gt;I found a solution for that but don't know if this is the optimum one or no, change the measure to&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Previous Month Measure =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(Fact_Sales[Month_ID]),&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;STRONG&gt;ALL(Fact_Sales)&lt;/STRONG&gt;, Fact_Sales[Last Month]=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 12:54:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Refering-to-Another-Measure-is-giving-blank/m-p/3165872#M113854</guid>
      <dc:creator>john_elmasry</dc:creator>
      <dc:date>2023-03-31T12:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Refering to Another Measure is giving blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Refering-to-Another-Measure-is-giving-blank/m-p/3168429#M114119</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="539637" data-lia-user-login="john_elmasry" class="lia-mention lia-mention-user"&gt;john_elmasry&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes.&amp;nbsp;Your original formula is pretty close to the correct answer, but you need to add an ALL filter at the critical time.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/all-function-dax" target="_blank"&gt;ALL function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous Month Measure = CALCULATE(MAX(Fact_Sales[Month_ID]),filter(ALL(Fact_Sales), Fact_Sales[Last Month]=1))-1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;helps, then please consider&amp;nbsp;&lt;EM&gt;Accept it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 05:18:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Refering-to-Another-Measure-is-giving-blank/m-p/3168429#M114119</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2023-04-03T05:18:45Z</dc:date>
    </item>
  </channel>
</rss>

