<?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 calculation when no items existing in the source table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2378525#M61377</link>
    <description>&lt;P&gt;Hi，&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can change you formula as below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DEFINE
    MEASURE TBSource[sum1] =
        VAR result =
            CALCULATE ( SUM ( TBSource[Quantity] ) )
        RETURN
            IF ( ISBLANK ( result ), 0, IF ( result &amp;lt; 0, 0, result ) )
    VAR tb =
        ADDCOLUMNS (
            SUMMARIZECOLUMNS ( TBName[Name], TBSource[Code] ),
            "sum1",
                IF ( TBSource[Code] = "C3" &amp;amp;&amp;amp; TBSource[sum1] = 0, 5, TBSource[sum1] )
        )

EVALUATE
tb
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 11:39:27 GMT</pubDate>
    <dc:creator>v-easonf-msft</dc:creator>
    <dc:date>2022-03-07T11:39:27Z</dc:date>
    <item>
      <title>Measure calculation when no items existing in the source table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2364929#M60520</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a measure that compute a value depending on a field from the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my model&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here are the datas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In Dax Studio I have the following measure definition.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE

MEASURE TBSource[sum1]=
	var result = CALCULATE(sum(TBSource[Quantity]))
	RETURN IF (ISBLANK(result),0, IF(result&amp;lt; 0,0,result))

var tb = SUMMARIZECOLUMNS(
	TBName[Name],
	TBSource[Code],
	"sum1", [sum1]
	)


EVALUATE tb&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the result is the following&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;What I try to do is, when C3=0, then I want to change the quantity to 5.&lt;/P&gt;&lt;P&gt;The problem is that no datas exists for this code and the Name AA. How can I do that ? And I do not want to have this rule applied to C2, wich has also no data for the name BB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 14:50:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2364929#M60520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-28T14:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Measure calculation when no items existing in the source table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2365170#M60531</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure about data lineage but you may try&lt;/P&gt;&lt;P&gt;sum1 =&lt;BR /&gt;VAR tb1 =&lt;BR /&gt;SUMMARIZE ( TBName[Name], TBSource[Code], "sum1", SUM ( TBSource[Quantity] ) )&lt;BR /&gt;VAR tb2 =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;tb1,&lt;BR /&gt;"@sum1",&lt;BR /&gt;SWITCH (&lt;BR /&gt;TRUE,&lt;BR /&gt;[Code] = "C3"&lt;BR /&gt;&amp;amp;&amp;amp; [sum1] = 0, 5,&lt;BR /&gt;ISBLANK ( [sum1] ), 0,&lt;BR /&gt;[sum1] &amp;lt; 0, 0,&lt;BR /&gt;[sum1]&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX ( tb2, CALCULATE ( SUM ( [@sum1] ) ) )&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 22:18:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2365170#M60531</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-02-28T22:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Measure calculation when no items existing in the source table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2365638#M60548</link>
      <description>&lt;P&gt;It sounds like your data is incomplete. I'd recommend appending a new row to your TBSource table before loading it into your model rather than trying to add data via measures.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 21:31:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2365638#M60548</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-02-28T21:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Measure calculation when no items existing in the source table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2378525#M61377</link>
      <description>&lt;P&gt;Hi，&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can change you formula as below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DEFINE
    MEASURE TBSource[sum1] =
        VAR result =
            CALCULATE ( SUM ( TBSource[Quantity] ) )
        RETURN
            IF ( ISBLANK ( result ), 0, IF ( result &amp;lt; 0, 0, result ) )
    VAR tb =
        ADDCOLUMNS (
            SUMMARIZECOLUMNS ( TBName[Name], TBSource[Code] ),
            "sum1",
                IF ( TBSource[Code] = "C3" &amp;amp;&amp;amp; TBSource[sum1] = 0, 5, TBSource[sum1] )
        )

EVALUATE
tb
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 11:39:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-calculation-when-no-items-existing-in-the-source-table/m-p/2378525#M61377</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-03-07T11:39:27Z</dc:date>
    </item>
  </channel>
</rss>

