<?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: Get Value for month end and current date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1547239#M30599</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267453" data-lia-user-login="sekinod" class="lia-mention lia-mention-user"&gt;sekinod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new measure using the one we already had:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Target measure TOT = SUMX( DISTINCT(Dates[Date]), [Target measure]) &lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 13 Dec 2020 12:24:07 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-12-13T12:24:07Z</dc:date>
    <item>
      <title>Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545594#M30510</link>
      <description>&lt;P&gt;The following data contains the target values which are given for each month end.&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 want is when select a date in slicer, all the month-end values must be shown within the selected date year up to selected date month and current date. For example if I select 12/14/2018 result table should be the following. For selected date month value should be multiplied by (working day up to that date in the month/total working dates in the month) because selected date is less than month end, other month-end value same as the data file month end value.&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;I have attached sample pbix file:&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AkvdsC9vi704mxxIf0JpbqK8s6zz" target="_self"&gt;sample.pbix&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 13:28:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545594#M30510</guid>
      <dc:creator>sekinod</dc:creator>
      <dc:date>2020-12-11T13:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545788#M30517</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267453" data-lia-user-login="sekinod" class="lia-mention lia-mention-user"&gt;sekinod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where exactly&amp;nbsp; do you get the target value for 01/31/2018 from? I see many values for that date on the Target[Amount] and none matches that value. How do you select the value from all the values for that date?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&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;</description>
      <pubDate>Fri, 11 Dec 2020 15:01:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545788#M30517</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-11T15:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545808#M30518</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It was according to product wise. sum of productof All "FD+1+2+3 ". And it should be filtered by branch.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 15:08:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545808#M30518</guid>
      <dc:creator>sekinod</dc:creator>
      <dc:date>2020-12-11T15:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545860#M30521</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;It was according to product wise. sum of productof All "FD+1+2+3 ". And it should be filtered by branch.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267453" data-lia-user-login="sekinod" class="lia-mention lia-mention-user"&gt;sekinod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;?? Please provide an example with the numbers to show how you come up with that figure.&amp;nbsp; I have no idea what&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;product wise. sum of productof All "FD+1+2+3 "&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;means&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 15:23:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545860#M30521</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-11T15:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545921#M30524</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&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;Here is example.&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Value is filtered to Date of 1/31/18 and Branch 106 and for all three products. sum of all three amount should be shown as on the previous table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 15:56:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1545921#M30524</guid>
      <dc:creator>sekinod</dc:creator>
      <dc:date>2020-12-11T15:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1546073#M30529</link>
      <description>&lt;P&gt;Dear&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267453" data-lia-user-login="sekinod" class="lia-mention lia-mention-user"&gt;sekinod&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Here is the measure. I also added an auxiliary dates tables to use for the slicer. See it all at work in the attached file. I would recommend to add the working days column in Dates in PQ, or in DAX but avoiding the bidirectional relationship&amp;nbsp; with Holidays &lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Target measure = 
VAR selectedYear_ = SELECTEDVALUE ( AuxDates[Year] )
VAR selectedYM_ = SELECTEDVALUE ( AuxDates[Year MonthNr] )
VAR selectedDate_ = SELECTEDVALUE ( AuxDates[Date] )
VAR currentYear_ = SELECTEDVALUE ( Dates[Year] )
VAR currentYM_ = SELECTEDVALUE ( Dates[Year MonthNr] )
VAR currentDate_ = SELECTEDVALUE ( Dates[Date] )
RETURN
    IF (
        currentYear_ = selectedYear_,
        SWITCH (
            TRUE (),
            currentYM_ &amp;lt; selectedYM_,
                IF (
                    EOMONTH ( currentDate_, 0 ) = currentDate_,
                    CALCULATE ( SUM ( Target[Amount] ), Target[Product] IN { "FD", "1", "2", "3" } )
                ),
            currentYM_ = selectedYM_,
                IF (
                    currentDate_ = selectedDate_,
                    VAR totalTargetMonth_ =
                        CALCULATE (
                            SUM ( Target[Amount] ),
                            Dates[Date] = EOMONTH ( currentDate_, 0 ),
                            Target[Product] IN { "FD", "1", "2", "3" }
                        )
                    VAR totalWDaysInMonth_ =
                        CALCULATE (
                            SUM ( Dates[Working Day] ),
                            Dates[Year MonthNr] = currentYM_,
                            ALL ( Dates )
                        )
                    VAR totalWDaysInPeriod_ =
                        CALCULATE (
                            SUM ( Dates[Working Day] ),
                            Dates[Year MonthNr] = currentYM_,
                            Dates[Date] &amp;lt;= currentDate_,
                            ALL ( Dates )
                        )
                    VAR ratio_ =
                        DIVIDE ( totalWDaysInPeriod_, totalWDaysInMonth_ )
                    RETURN
                        totalTargetMonth_ * ratio_
                )
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 17:21:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1546073#M30529</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-11T17:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1546441#M30542</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help, it is much appreciated. I accepted your answer as the solution. If is not much could please tell me how I can get the total at bottom of the table visualization.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 02:40:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1546441#M30542</guid>
      <dc:creator>sekinod</dc:creator>
      <dc:date>2020-12-12T02:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get Value for month end and current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1547239#M30599</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267453" data-lia-user-login="sekinod" class="lia-mention lia-mention-user"&gt;sekinod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new measure using the one we already had:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Target measure TOT = SUMX( DISTINCT(Dates[Date]), [Target measure]) &lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 12:24:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Value-for-month-end-and-current-date/m-p/1547239#M30599</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-13T12:24:07Z</dc:date>
    </item>
  </channel>
</rss>

