<?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: Measure taking on invalid values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553591#M136740</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="232552" data-lia-user-login="jetform_consult" class="lia-mention lia-mention-user"&gt;jetform_consult&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure is not returning phantom values, it's only working on a different logic then what you are expecting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each row of that matrix, having the context of the &lt;SPAN&gt;OrdersByCalendar_DTL[OrderDate] field, the measure is doing the correct calculation. The issue is on the "total" level, because in there the DAX doesn't have the context of that&amp;nbsp;OrdersByCalendar_DTL[OrderDate] field and is doing a calculation based on an aggregation of that field (if you see on your matrix there is a (blank) value for the "total" level of your SelectedDate measure, which "triggers" the&amp;nbsp;[CNT Date(SUM) per Period] for the "total" of the&amp;nbsp;MonthCol1&amp;nbsp;measure).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since you want a measure calculation that, on the "total" level, still takes in consideration the&amp;nbsp;OrdersByCalendar_DTL[OrderDate] field, you need to wrap your [MonthCol1] measure on a iterator that does the calculation for each row and afterwards does a aggregation. Something like this:&lt;/SPAN&gt;&lt;/P&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;LI-CODE lang="markup"&gt;MonthCol1 = 
SUMX(VALUES(OrdersByCalendar_DTL[OrderDate]);
IF([SelectedDate]=BLANK(); OrdersByCalendar_DTL[CNT Date(SUM) per Period]; Blank())
)&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;&lt;SPAN&gt;Based on a dummy dataset I've created, this is the behaviour of your measure and my suggestion with SUMX:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this answer solves your problem!&lt;BR /&gt;If you need any additional help please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply.&lt;BR /&gt;If my reply provided you with a solution, please consider marking it as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; or giving it a kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/jpessoa08" target="_blank" rel="noopener"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Jorge Pessoa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2023 08:57:17 GMT</pubDate>
    <dc:creator>jpessoa8</dc:creator>
    <dc:date>2023-11-27T08:57:17Z</dc:date>
    <item>
      <title>Measure taking on invalid values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553475#M136731</link>
      <description>&lt;P&gt;I have a Measure called [SelectedDate].&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;SelectedDate = IF(SELECTEDVALUE(OrdersByCalendar_DTL[OrderDate] )=Blank();Blank();SELECTEDVALUE ( OrdersByCalendar_DTL[OrderDate]))&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;I am attempting to use it to make a graph displaying Month totals disappear when a date is selected from a slicer...PowerBI-101.&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;MonthCol1 = IF([SelectedDate]="Blank"; OrdersByCalendar_DTL[CNT Date(SUM) per Period]; Blank())&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It worked until I switched the slicer to another slicer and now the measure seems to be returning PHANTOM values which is causing my IF([SelectedDate]=Blank();sum(Column1);Blank()) to ALWAYS return a value.&lt;/P&gt;&lt;P&gt;I only found this out (after pulling out half my hair) by switching the graph to a table and adding a CARD that displays the [SelectedDate] value. Low and behold, [SelectedDate] is populated with values in the table whilst the CARD clearly shows [SelectedDate] to be (Blank). Another strange fact is that while each date's MonthCol1 value is Blank() (as per the measure), the Total at the bottom is the correct tally for the month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried adding the measure to the graph's filter section and selecting IS BLANK...The graph now shows absolutely nothing even when selecting a date. This is due to (I believe) the [SelectedDate] measure taking on un-authorized date values as shown in the screen shot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 08:03:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553475#M136731</guid>
      <dc:creator>jetform_consult</dc:creator>
      <dc:date>2023-11-27T08:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Measure taking on invalid values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553591#M136740</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="232552" data-lia-user-login="jetform_consult" class="lia-mention lia-mention-user"&gt;jetform_consult&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure is not returning phantom values, it's only working on a different logic then what you are expecting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each row of that matrix, having the context of the &lt;SPAN&gt;OrdersByCalendar_DTL[OrderDate] field, the measure is doing the correct calculation. The issue is on the "total" level, because in there the DAX doesn't have the context of that&amp;nbsp;OrdersByCalendar_DTL[OrderDate] field and is doing a calculation based on an aggregation of that field (if you see on your matrix there is a (blank) value for the "total" level of your SelectedDate measure, which "triggers" the&amp;nbsp;[CNT Date(SUM) per Period] for the "total" of the&amp;nbsp;MonthCol1&amp;nbsp;measure).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since you want a measure calculation that, on the "total" level, still takes in consideration the&amp;nbsp;OrdersByCalendar_DTL[OrderDate] field, you need to wrap your [MonthCol1] measure on a iterator that does the calculation for each row and afterwards does a aggregation. Something like this:&lt;/SPAN&gt;&lt;/P&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;LI-CODE lang="markup"&gt;MonthCol1 = 
SUMX(VALUES(OrdersByCalendar_DTL[OrderDate]);
IF([SelectedDate]=BLANK(); OrdersByCalendar_DTL[CNT Date(SUM) per Period]; Blank())
)&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;&lt;SPAN&gt;Based on a dummy dataset I've created, this is the behaviour of your measure and my suggestion with SUMX:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this answer solves your problem!&lt;BR /&gt;If you need any additional help please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply.&lt;BR /&gt;If my reply provided you with a solution, please consider marking it as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; or giving it a kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/jpessoa08" target="_blank" rel="noopener"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Jorge Pessoa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 08:57:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553591#M136740</guid>
      <dc:creator>jpessoa8</dc:creator>
      <dc:date>2023-11-27T08:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Measure taking on invalid values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553687#M136742</link>
      <description>&lt;P&gt;Thank you Jorge for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this is not what I am attempting to do.&amp;nbsp; I only switched to a table to try to get an understanding of what was happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to do is to have 2 graphs superimposed on top of each other.&amp;nbsp; One graph will have MONTH values and the other graph will have the values for the date contained in [SelectedDate].&amp;nbsp; When no date is selected, my other measure (OrdersByCalendar_DTL[CNT &lt;STRONG&gt;Time&lt;/STRONG&gt;(SUM) per Period]) is Blank().&amp;nbsp; If you select a date, [SelectedDate] takes on that value and OrdersByCalendar_DTL[CNT &lt;STRONG&gt;Date&lt;/STRONG&gt;(SUM) per Period] takes on a value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is supposed to make one graph ALWAYS show Blank() values and allows you to "seemingly" switch between 2 different graphs...One for the entire month, and the other for just a single day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This use to work until I changed my date slicer from a PowerSlicer to a PivotSlicer because of other issues with the PowerSlicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No Date selected...Should show the entire Month&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you select a date...The Month graph should be flooded with Blank() values making it transparent to reveal the TOD graph beneath it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 09:27:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553687#M136742</guid>
      <dc:creator>jetform_consult</dc:creator>
      <dc:date>2023-11-27T09:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Measure taking on invalid values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553855#M136747</link>
      <description>&lt;P&gt;Sorry for the misunderstanding&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="232552" data-lia-user-login="jetform_consult" class="lia-mention lia-mention-user"&gt;jetform_consult&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment what is the behaviour on the Month graph? Can you provide a print? I couldn't understand from your explanation&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Jorge Pessoa&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 10:38:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3553855#M136747</guid>
      <dc:creator>jpessoa8</dc:creator>
      <dc:date>2023-11-27T10:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Measure taking on invalid values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3558682#M137095</link>
      <description>&lt;P&gt;Hi Jorge...Thanks for your valuable time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe I found the issue.&amp;nbsp; The problem only reared its ulgy head when I attempted to clean up (what I thought were) unneeded tables from 5 downto 3.&amp;nbsp; It was then the relations between the new consolidated tables and the rest of the tables that 'somehow' caused the measures to misbehave.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simply went back to the original table format, cleaned up a few unneeded relationships with the new tables, and everything started working again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks once again for your tips and your time.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 11:25:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-taking-on-invalid-values/m-p/3558682#M137095</guid>
      <dc:creator>jetform_consult</dc:creator>
      <dc:date>2023-11-29T11:25:48Z</dc:date>
    </item>
  </channel>
</rss>

