<?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: Guidance required for adding custom colomn with Toal YTD function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Guidance-required-for-adding-custom-colomn-with-Toal-YTD/m-p/1695231#M34880</link>
    <description>&lt;P&gt;hi, i think this is what you want.&lt;/P&gt;&lt;P&gt;some one clever than me could probably make it simpler using one of the fancy pants dax functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YTDAchievement=
var _YTDTarget=CALCULATE(SUM(Table1[Sale Target Nos.]),
                         FILTER(ALLEXCEPT(Table1,Table1[Customer Code]),
                                Table1[Month]&amp;lt;=EARLIER(Table1[Month]) 
                                &amp;amp;&amp;amp; YEAR(Table1[Month])=YEAR(EARLIER(Table1[Month]))
                         ))
var _YTDActual=CALCULATE(SUM(Table1[Actual Sale Nos]),
                         FILTER(ALLEXCEPT(Table1,Table1[Customer Code]),
                                Table1[Month]&amp;lt;=EARLIER(Table1[Month])
                                &amp;amp;&amp;amp; YEAR(Table1[Month])=YEAR(EARLIER(Table1[Month]))
                         ))
return DIVIDE(_YTDActual,_YTDTarget)&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;LI-CODE lang="markup"&gt;YTDAchColour = SWITCH(true(), 
               [YTDAchievement]&amp;gt;=1,"Green",
               Table1[YTDAchievement]&amp;gt;=0.8,"Blue",
               "Red")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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, 01 Mar 2021 06:52:45 GMT</pubDate>
    <dc:creator>rfigtree</dc:creator>
    <dc:date>2021-03-01T06:52:45Z</dc:date>
    <item>
      <title>Guidance required for adding custom colomn with Toal YTD function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Guidance-required-for-adding-custom-colomn-with-Toal-YTD/m-p/1695066#M34878</link>
      <description>&lt;P&gt;Hi Super User.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am farely new to Power BI community. Recently I am preparing excel report for our organization. Report is pretty simple in excel. However to make it dynamic &amp;amp; automatic, I start to compile a Dashboard with Power Query. Later will shift to Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has only 4 coloumn. Customer Code/ Month/ Sale Target Nos. / Actual Sale Nos.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My requirement:&lt;/P&gt;&lt;P&gt;I need to find out by Customer Status by counting no. of customers in green/ blue/ red category&lt;/P&gt;&lt;P&gt;Green = If Target Ach % is 100% or more&lt;/P&gt;&lt;P&gt;Blue = If Target Ach % is 80%~99% or more&lt;/P&gt;&lt;P&gt;Red = If Target Ach % is below 80%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Target Ach% = Actual Sale Nos. divided by Sale Target Nos.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I could add Target Ach % and Customer Status by adding conditional coloumn howevr this shown each month customer status is green or red or blue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, my requirement is, I want to calculate YTD Target Ach% for each. For eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Customer code: 15700,&lt;/P&gt;&lt;P&gt;In Jan -&amp;gt; should show Jan Tgt Vs Jan Result, and&lt;/P&gt;&lt;P&gt;in Feb should show Jan~Feb cumm Tgt vs Jan~Feb cumm Actual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pls. guide on how to write formula accordingly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nikhil Gour.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 05:28:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Guidance-required-for-adding-custom-colomn-with-Toal-YTD/m-p/1695066#M34878</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-01T05:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Guidance required for adding custom colomn with Toal YTD function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Guidance-required-for-adding-custom-colomn-with-Toal-YTD/m-p/1695231#M34880</link>
      <description>&lt;P&gt;hi, i think this is what you want.&lt;/P&gt;&lt;P&gt;some one clever than me could probably make it simpler using one of the fancy pants dax functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YTDAchievement=
var _YTDTarget=CALCULATE(SUM(Table1[Sale Target Nos.]),
                         FILTER(ALLEXCEPT(Table1,Table1[Customer Code]),
                                Table1[Month]&amp;lt;=EARLIER(Table1[Month]) 
                                &amp;amp;&amp;amp; YEAR(Table1[Month])=YEAR(EARLIER(Table1[Month]))
                         ))
var _YTDActual=CALCULATE(SUM(Table1[Actual Sale Nos]),
                         FILTER(ALLEXCEPT(Table1,Table1[Customer Code]),
                                Table1[Month]&amp;lt;=EARLIER(Table1[Month])
                                &amp;amp;&amp;amp; YEAR(Table1[Month])=YEAR(EARLIER(Table1[Month]))
                         ))
return DIVIDE(_YTDActual,_YTDTarget)&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;LI-CODE lang="markup"&gt;YTDAchColour = SWITCH(true(), 
               [YTDAchievement]&amp;gt;=1,"Green",
               Table1[YTDAchievement]&amp;gt;=0.8,"Blue",
               "Red")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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, 01 Mar 2021 06:52:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Guidance-required-for-adding-custom-colomn-with-Toal-YTD/m-p/1695231#M34880</guid>
      <dc:creator>rfigtree</dc:creator>
      <dc:date>2021-03-01T06:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Guidance required for adding custom colomn with Toal YTD function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Guidance-required-for-adding-custom-colomn-with-Toal-YTD/m-p/1695543#M34885</link>
      <description>&lt;P&gt;Brother, thanks for advise. You correctly understood my requirement.&lt;/P&gt;&lt;P&gt;I tried DAX as advised for only YTD Target colomn in data model.&lt;/P&gt;&lt;P&gt;However it is showing total of month ir-respective of customerwise wise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used below mentioned DAX as per your advise:&lt;/P&gt;&lt;P&gt;&lt;!-- StartFragment  --&gt;&lt;/P&gt;&lt;P&gt;&lt;!-- StartFragment  --&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;= &lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;([Sum of AMC WS Target],&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;FILTER&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;('AMC WS Red Dealer Analysis','AMC WS Red Dealer Analysis'[Network Code]),'AMC WS Red Dealer Analysis'[AMC Red Dealer Month]&amp;lt;=&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;EARLIER&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;('AMC WS Red Dealer Analysis'[AMC Red Dealer Month]) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;('AMC WS Red Dealer Analysis'[AMC Red Dealer Month])=&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;EARLIER&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;('AMC WS Red Dealer Analysis'[AMC Red Dealer Month]))))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;!-- EndFragment  --&gt;&lt;/P&gt;&lt;P&gt;&lt;!-- EndFragment  --&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 08:37:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Guidance-required-for-adding-custom-colomn-with-Toal-YTD/m-p/1695543#M34885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-01T08:37:18Z</dc:date>
    </item>
  </channel>
</rss>

