<?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: Issues in Measure with Date slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3653916#M141561</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EventDurationMeasure =
VAR _rangeStart = CALCULATE(MIN(DateRange[Date]))
VAR _rangeEnd = CALCULATE(MAX(DateRange[Date]))
VAR _eventStartDate = SELECTEDVALUE(EventTable[StartDate])
VAR _eventEndDate = SELECTEDVALUE(EventTable[EndDate])
VAR _eventStatus =
    IF(
        _eventEndDate &amp;gt; _rangeEnd,
        "In progress",
        IF(
            _eventEndDate &amp;gt;= _rangeStart &amp;amp;&amp;amp; _eventEndDate &amp;lt;= DATEADD(_rangeStart, 6, MONTH),
            "0-6 mnd",
            IF(
                _eventEndDate &amp;gt; DATEADD(_rangeStart, 6, MONTH) &amp;amp;&amp;amp; _eventEndDate &amp;lt;= DATEADD(_rangeStart, 9, MONTH),
                "6-9 mnd",
                IF(
                    _eventEndDate &amp;gt; DATEADD(_rangeStart, 9, MONTH) &amp;amp;&amp;amp; _eventEndDate &amp;lt;= DATEADD(_rangeStart, 12, MONTH),
                    "9-12 mnd",
                    BLANK()
                )
            )
        )
    )
RETURN
    _eventStatus&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure uses DATESBETWEEN to calculate the events falling within the date range defined by the slicer. It then checks the event end date against different date ranges and assigns the appropriate label ("0-6 mnd", "6-9 mnd", "9-12 mnd", "In progress").&lt;/P&gt;&lt;P&gt;Make sure to replace the column names and adjust the logic as needed based on your actual data model.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2024 11:34:02 GMT</pubDate>
    <dc:creator>_elbpower</dc:creator>
    <dc:date>2024-01-23T11:34:02Z</dc:date>
    <item>
      <title>Issues in Measure with Date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3653854#M141558</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;BR /&gt;We have a table for storing event details (EventTable) with Startdate and Enddate.In Power BI report we have a date range slicer. Based on the date slicer, we need to show the number of events in the date slicer duration as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;0-6 months&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;6-9 months&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;9-12 months&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;In progress&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here, "In progress" indicates the event was not finished during the slicer date range even though the event finished after the date&amp;nbsp; slicer end date.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Challenge we are facing is in the measure, In this measure we are not getting the if condition evaluate properly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;EventDurationMeasure =&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var _rangeStart=CALCULATE(MIN(DateRange[Date]),ALLSELECTED('DateRange'))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var _rangeEnd=CALCULATE(MAX(DateRange[Date]),ALLSELECTED('DateRange'))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;IF(SELECTEDVALUE(EventTable[EndDate]) &amp;gt; _rangeEnd, "In progress", "0-6 mnd") // To add other date ranges&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, always it shows the else condition (&lt;EM&gt;0-6 mnd)&lt;/EM&gt; and the total count without considering the date slicer range&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly guide me whats wrong here&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you all for the support&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 11:06:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3653854#M141558</guid>
      <dc:creator>sebanmathews</dc:creator>
      <dc:date>2024-01-23T11:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Issues in Measure with Date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3653916#M141561</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EventDurationMeasure =
VAR _rangeStart = CALCULATE(MIN(DateRange[Date]))
VAR _rangeEnd = CALCULATE(MAX(DateRange[Date]))
VAR _eventStartDate = SELECTEDVALUE(EventTable[StartDate])
VAR _eventEndDate = SELECTEDVALUE(EventTable[EndDate])
VAR _eventStatus =
    IF(
        _eventEndDate &amp;gt; _rangeEnd,
        "In progress",
        IF(
            _eventEndDate &amp;gt;= _rangeStart &amp;amp;&amp;amp; _eventEndDate &amp;lt;= DATEADD(_rangeStart, 6, MONTH),
            "0-6 mnd",
            IF(
                _eventEndDate &amp;gt; DATEADD(_rangeStart, 6, MONTH) &amp;amp;&amp;amp; _eventEndDate &amp;lt;= DATEADD(_rangeStart, 9, MONTH),
                "6-9 mnd",
                IF(
                    _eventEndDate &amp;gt; DATEADD(_rangeStart, 9, MONTH) &amp;amp;&amp;amp; _eventEndDate &amp;lt;= DATEADD(_rangeStart, 12, MONTH),
                    "9-12 mnd",
                    BLANK()
                )
            )
        )
    )
RETURN
    _eventStatus&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure uses DATESBETWEEN to calculate the events falling within the date range defined by the slicer. It then checks the event end date against different date ranges and assigns the appropriate label ("0-6 mnd", "6-9 mnd", "9-12 mnd", "In progress").&lt;/P&gt;&lt;P&gt;Make sure to replace the column names and adjust the logic as needed based on your actual data model.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 11:34:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3653916#M141561</guid>
      <dc:creator>_elbpower</dc:creator>
      <dc:date>2024-01-23T11:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Issues in Measure with Date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3656224#M141654</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678767" data-lia-user-login="sebanmathews" class="lia-mention lia-mention-user"&gt;sebanmathews&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;According to your description, I can not see any error in the IF condition you wrote, it displays "In process" and "0-6 mnd" correctly. You can try the _elbpower method, if it doesn't work, you need to share the pbix file without sensitive data, the datasheet, the desired output and the logic to achieve the output.&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;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365912356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7IzyI2%2FMOAR%2FYCjWYSKCZL2VPmT4PsxuWBjdUdMWKzo%3D&amp;amp;reserved=0" target="_blank"&gt;How to get your questions answered quickly&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365919045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=VeafzdwAsrpisD8s261%2FdyOwJ1aCtBXS3bPA6NODOHY%3D&amp;amp;reserved=0" target="_blank"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 09:23:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3656224#M141654</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-24T09:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issues in Measure with Date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3657446#M141706</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;When I display the individual rows in table it looks fine. But when I added count of EventTable rows instead of 'EndDate' , then I am not getting the proper result&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 15:06:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3657446#M141706</guid>
      <dc:creator>sebanmathews</dc:creator>
      <dc:date>2024-01-24T15:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Issues in Measure with Date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3657452#M141707</link>
      <description>&lt;P&gt;Thank you for the help. By using this measure, I am not getting the result.It is giving errors in the measure.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 15:09:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3657452#M141707</guid>
      <dc:creator>sebanmathews</dc:creator>
      <dc:date>2024-01-24T15:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Issues in Measure with Date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3669634#M142314</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678767" data-lia-user-login="sebanmathews" class="lia-mention lia-mention-user"&gt;sebanmathews&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can share the pbix file without sensitive data or post a complete reproduction of the problem with the data table, measure, desired effect, and the logic to achieve the effect and other information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365912356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7IzyI2%2FMOAR%2FYCjWYSKCZL2VPmT4PsxuWBjdUdMWKzo%3D&amp;amp;reserved=0" target="_blank"&gt;How to get your questions answered quickly&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365919045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=VeafzdwAsrpisD8s261%2FdyOwJ1aCtBXS3bPA6NODOHY%3D&amp;amp;reserved=0" target="_blank"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 07:09:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3669634#M142314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-31T07:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issues in Measure with Date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3674970#M142637</link>
      <description>&lt;P&gt;what is the error?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 08:00:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-in-Measure-with-Date-slicer/m-p/3674970#M142637</guid>
      <dc:creator>_elbpower</dc:creator>
      <dc:date>2024-02-02T08:00:28Z</dc:date>
    </item>
  </channel>
</rss>

