<?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: Target to date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2490255#M68535</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369336" data-lia-user-login="renlaforest" class="lia-mention lia-mention-user"&gt;renlaforest&lt;/a&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;This error shows that you are using the custom column feature in powerquery.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But the code is DAX, not M code.&lt;/STRONG&gt; You need to create it in desktop.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Janey&lt;BR /&gt;If this post helps, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 07:33:31 GMT</pubDate>
    <dc:creator>v-janeyg-msft</dc:creator>
    <dc:date>2022-05-03T07:33:31Z</dc:date>
    <item>
      <title>Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2475272#M67563</link>
      <description>&lt;P&gt;Hello - I'm new to Power BI and DAX. I've strugged with figuring out the following.&lt;/P&gt;&lt;P&gt;I have a start date for the project and a close date, and I created a column to calculate the total number of days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I've also got a total target column for those dates. If the total target is 1000, and yesterday was half way through the start and close dates, I'd like the target to be 500. If today's after the close date, I'd like the target to be 1000. For clarify, if today's the close date, and the project is open for 10 days, I'd like the target to be 900.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the example above, the target shouldn't be 3288 - it should be 1644 since we're half way through the dates that the project is open.&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 14:42:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2475272#M67563</guid>
      <dc:creator>renlaforest</dc:creator>
      <dc:date>2022-04-25T14:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2475570#M67577</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369336" data-lia-user-login="renlaforest" class="lia-mention lia-mention-user"&gt;renlaforest&lt;/a&gt; , Can you check one of the two approaches can help &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 16:30:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2475570#M67577</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-04-25T16:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2481948#M67982</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369336" data-lia-user-login="renlaforest" class="lia-mention lia-mention-user"&gt;renlaforest&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't understand your requirements. Your dates are all in 2021, and the examples you gave are all today and yesterday. Is there any connection between them? Can you explain more details?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Janey&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 03:24:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2481948#M67982</guid>
      <dc:creator>v-janeyg-msft</dc:creator>
      <dc:date>2022-04-28T03:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2483500#M68101</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="259995" data-lia-user-login="v-janeyg-msft" class="lia-mention lia-mention-user"&gt;v-janeyg-msft&lt;/a&gt;&amp;nbsp;- the table has dates from 2021 to 2023. The snip that I took is from the top, which only shows the older, closed projects. There are dates in the table that span each week of the year. Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 13:55:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2483500#M68101</guid>
      <dc:creator>renlaforest</dc:creator>
      <dc:date>2022-04-28T13:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2483926#M68128</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="259995" data-lia-user-login="v-janeyg-msft" class="lia-mention lia-mention-user"&gt;v-janeyg-msft&lt;/a&gt;&amp;nbsp;- the table has all of the dates for our projects between 2021 and 2023, and you're seeing the older projects at the top of the list. If I wanted to do this in Excel, there may be a more elegant way to do this, but I'd use a formula like this one to do what I'm trying to do here:&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>Thu, 28 Apr 2022 16:48:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2483926#M68128</guid>
      <dc:creator>renlaforest</dc:creator>
      <dc:date>2022-04-28T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2485256#M68199</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369336" data-lia-user-login="renlaforest" class="lia-mention lia-mention-user"&gt;renlaforest&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;column =
IF (
    TODAY () &amp;gt; [Start],
    IF (
        TODAY () &amp;lt;= [Close],
        [Total target]
            / ( DATEDIFF ( [Start], [Close], DAY ) + 1 )
            * ( DATEDIFF ( [Start], TODAY (), DAY ) + 1 ),
        [Total target]
    ),
    0
)

&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Janey&lt;BR /&gt;If this post helps, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 08:34:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2485256#M68199</guid>
      <dc:creator>v-janeyg-msft</dc:creator>
      <dc:date>2022-04-29T08:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2486334#M68285</link>
      <description>&lt;P&gt;Thank you so much for your help. For some reason, and I've tried Googling (unsuccesfuly) what could be causing it, but I get an error message:&amp;nbsp;Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly.&lt;/P&gt;&lt;P&gt;I have:&lt;/P&gt;&lt;P&gt;IF (&lt;BR /&gt;TODAY () &amp;gt; [Start Date],&lt;BR /&gt;IF (&lt;BR /&gt;TODAY () &amp;lt;= [Close Date],&lt;BR /&gt;([EN Targeted Completes]&lt;BR /&gt;/ ( DATEDIFF ( [Start Date], [Close Date], DAY ) + 1 ))&lt;BR /&gt;* ( DATEDIFF ( [Start Date], TODAY (), DAY ) + 1 ),&lt;BR /&gt;[EN Targeted Completes]&lt;BR /&gt;),&lt;BR /&gt;0&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 18:17:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2486334#M68285</guid>
      <dc:creator>renlaforest</dc:creator>
      <dc:date>2022-04-29T18:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Target to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2490255#M68535</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369336" data-lia-user-login="renlaforest" class="lia-mention lia-mention-user"&gt;renlaforest&lt;/a&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;This error shows that you are using the custom column feature in powerquery.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But the code is DAX, not M code.&lt;/STRONG&gt; You need to create it in desktop.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Janey&lt;BR /&gt;If this post helps, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 07:33:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-to-date/m-p/2490255#M68535</guid>
      <dc:creator>v-janeyg-msft</dc:creator>
      <dc:date>2022-05-03T07:33:31Z</dc:date>
    </item>
  </channel>
</rss>

