<?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 Dax measure for if date is smaller than maximum selected date from slicer then sumA else SumB in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4733474#M181359</link>
    <description>&lt;P&gt;I want to show a matrix table showing actuals if dates is smaller than e.g. 31 May 2025 then budget values if after this date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was using this formula&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FORECAST = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FIRSTDATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Budget_data[Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;= DATE(2025,05,31),&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'PnL Data_2025'[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Budget_data[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I now want the dashboard user to select a dates on the slicer instead of me hard coding the cut off date.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jun 2025 11:57:11 GMT</pubDate>
    <dc:creator>ILLANA_N</dc:creator>
    <dc:date>2025-06-16T11:57:11Z</dc:date>
    <item>
      <title>Dax measure for if date is smaller than maximum selected date from slicer then sumA else SumB</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4733474#M181359</link>
      <description>&lt;P&gt;I want to show a matrix table showing actuals if dates is smaller than e.g. 31 May 2025 then budget values if after this date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was using this formula&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FORECAST = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FIRSTDATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Budget_data[Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;= DATE(2025,05,31),&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'PnL Data_2025'[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Budget_data[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I now want the dashboard user to select a dates on the slicer instead of me hard coding the cut off date.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 11:57:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4733474#M181359</guid>
      <dc:creator>ILLANA_N</dc:creator>
      <dc:date>2025-06-16T11:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dax measure for if date is smaller than maximum selected date from slicer then sumA else SumB</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4734932#M181361</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1290630" data-lia-user-login="ILLANA_N" class="lia-mention lia-mention-user"&gt;ILLANA_N&lt;/a&gt;&amp;nbsp;Create a date slicer in your Power BI report.&lt;BR /&gt;Use the SELECTEDVALUE function to get the date selected by the user.&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;FORECAST = &lt;BR /&gt;VAR SelectedDate = SELECTEDVALUE(DateTable[Date])&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;SelectedDate &amp;lt;= DATE(2025, 05, 31),&lt;BR /&gt;SUM('PnL Data_2025'[Amount]),&lt;BR /&gt;SUM(Budget_data[Amount])&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 15:12:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4734932#M181361</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-06-17T15:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dax measure for if date is smaller than maximum selected date from slicer then sumA else SumB</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4735313#M181382</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Expected result measure: = 
VAR _selecteddate =
    SELECTEDVALUE ( 'Calendar slicer'[date], DATE ( 2025, 5, 31 ) )
VAR _pnldata =
    SUM ( 'PnL Data_2025'[amount] )
VAR _budget =
    SUM ( Budget_data[amount] )
VAR _t =
    ADDCOLUMNS (
        VALUES ( 'Calendar'[date] ),
        "@result",
            IF (
                'Calendar'[date] &amp;lt;= _selecteddate,
                CALCULATE ( SUM ( 'PnL Data_2025'[amount] ) ),
                CALCULATE ( SUM ( Budget_data[amount] ) )
            )
    )
RETURN
    SUMX ( _t, [@result] )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 03:03:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4735313#M181382</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2025-06-18T03:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dax measure for if date is smaller than maximum selected date from slicer then sumA else SumB</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4736708#M181424</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1290630" data-lia-user-login="ILLANA_N" class="lia-mention lia-mention-user"&gt;ILLANA_N&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you &amp;nbsp;for reaching out to the Microsoft fabric community forum.&lt;/P&gt;
&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;,&amp;nbsp;for sharing such a clear and practical solution really appreciate the effort you put into recreating the sample model and measure logic &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please&amp;nbsp;&lt;STRONG&gt;Accept&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;it as a solution&lt;/STRONG&gt;&amp;nbsp;so that other community members can find it easily.&lt;BR /&gt;Regards,&lt;BR /&gt;Harshitha.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 04:37:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4736708#M181424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-19T04:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dax measure for if date is smaller than maximum selected date from slicer then sumA else SumB</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4739949#M181533</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1290630" data-lia-user-login="ILLANA_N" class="lia-mention lia-mention-user"&gt;ILLANA_N&lt;/a&gt;,&lt;BR /&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please &lt;STRONG&gt;Accept it as a solution&lt;/STRONG&gt; so that other community members can find it easily.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 04:18:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4739949#M181533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-23T04:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dax measure for if date is smaller than maximum selected date from slicer then sumA else SumB</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4744611#M181668</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1290630" data-lia-user-login="ILLANA_N" class="lia-mention lia-mention-user"&gt;ILLANA_N&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and &lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 07:06:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-if-date-is-smaller-than-maximum-selected-date/m-p/4744611#M181668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-26T07:06:17Z</dc:date>
    </item>
  </channel>
</rss>

