<?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: Addition to a certain level, to calculate with that. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Addition-to-a-certain-level-to-calculate-with-that/m-p/2809860#M88920</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284859" data-lia-user-login="brief001" class="lia-mention lia-mention-user"&gt;brief001&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The criteria for "Good" is not clear therefore, I assumed. Please refer to attached sample file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Total Amount = SUM ( Amount[Amount] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Total Target = SUM ( Target[Target] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;# Good = 
SUMX ( 
    CROSSJOIN ( VALUES ( 'Date'[Date] ), VALUES ( 'Cluster'[Cluster] ) ),
    IF ( 
        [Total Amount] &amp;gt;= [Total Target],
        1,
        0
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Denominator = 
SUMX ( 
    CROSSJOIN ( VALUES ( 'Date'[Date] ), VALUES ( 'Cluster'[Cluster] ) ),
    1
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;% Good = 
DIVIDE (
    [# Good],
    [Denominator]
)&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 01 Oct 2022 08:32:03 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-10-01T08:32:03Z</dc:date>
    <item>
      <title>Addition to a certain level, to calculate with that.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Addition-to-a-certain-level-to-calculate-with-that/m-p/2809843#M88916</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two fact tables. This contains the amount achieved on a daily basis and on a district level.&lt;BR /&gt;And in the other table is also on a daily basis and at district level only in this we see the expected target.&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We do have the expected target at district level, but the target applies at cluster level.&lt;BR /&gt;So both the target and the amount achieved must be added up on a daily basis to the achieved cluster level.&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The wish is that I get three measurements.&lt;BR /&gt;One that indicates with a 1 or 0 whether the achieved amount was higher or equal to the expected target.&lt;BR /&gt;One measurement should become the denominator of the fraction.&lt;BR /&gt;And the last measurement is the result of the fraction in percentage.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Examples Table 1:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrLUNbDUNTJS0lFyziktLkktUghKTQHyXDKLS4oyk0sUHIEcU6VYHWLVGhoQqdiJZoqdSXAyqWoNcSp2yilNRVYdAeQY43QyNtUmRKuOJMnsSJLMjqKxaqi7jQ1ISE1UVuwEj3TqqnWmoVpDnIrxJCWqqwYlJSOSVBNvdhSNVYOSRywA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Cluster = _t, District = _t, Amount = _t]),&lt;BR /&gt;#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"Date", type date}, {"Cluster", type text}, {"District", type text}, {"Amount", Int64.Type}})&lt;BR /&gt;in&lt;BR /&gt;#"Type gewijzigd"&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples Table 2:&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tdKxCoMwEAbgV5HMCiaxrRkb+wSd2opTm0Fw0vj+XlooUu7gz9Dx4OPncvn7XhlX1a4yRpWqm9Ylhrm4hhdNl3GJ8/iMxZmGRg0lah1oPQ3aZOAWtB0NxwyLPi5ZLQb7aQ17faPBiLfgtIX1PWUfcrQVH/mrH+kicPZbZ2Xbz5fbGulSm2G1BrH/9gOzDWhTP05/stpKmG2SeDdWi4uwvRP/j+2deGi2G/Deu5aCmqKHDQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Cluster = _t, District = _t, Target = _t]),&lt;BR /&gt;#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"Date", type date}, {"Cluster", type text}, {"District", type text}, {"Target", Int64.Type}})&lt;BR /&gt;in&lt;BR /&gt;#"Type gewijzigd"&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 07:42:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Addition-to-a-certain-level-to-calculate-with-that/m-p/2809843#M88916</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-01T07:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Addition to a certain level, to calculate with that.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Addition-to-a-certain-level-to-calculate-with-that/m-p/2809860#M88920</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284859" data-lia-user-login="brief001" class="lia-mention lia-mention-user"&gt;brief001&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The criteria for "Good" is not clear therefore, I assumed. Please refer to attached sample file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Total Amount = SUM ( Amount[Amount] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Total Target = SUM ( Target[Target] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;# Good = 
SUMX ( 
    CROSSJOIN ( VALUES ( 'Date'[Date] ), VALUES ( 'Cluster'[Cluster] ) ),
    IF ( 
        [Total Amount] &amp;gt;= [Total Target],
        1,
        0
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Denominator = 
SUMX ( 
    CROSSJOIN ( VALUES ( 'Date'[Date] ), VALUES ( 'Cluster'[Cluster] ) ),
    1
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;% Good = 
DIVIDE (
    [# Good],
    [Denominator]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 01 Oct 2022 08:32:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Addition-to-a-certain-level-to-calculate-with-that/m-p/2809860#M88920</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-01T08:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Addition to a certain level, to calculate with that.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Addition-to-a-certain-level-to-calculate-with-that/m-p/2810005#M88942</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Your solution is fantastic, and does exactly what I wanted. In my model I also had two dimension tables linked to both tables. This allowed me to take over your meetings right away.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I was not yet familiar with the crossjoin, so I immediately looked up more about it, it is now clear to me.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you so much! My weekend is already a success, thanks to your response.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 12:36:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Addition-to-a-certain-level-to-calculate-with-that/m-p/2810005#M88942</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-01T12:36:58Z</dc:date>
    </item>
  </channel>
</rss>

