<?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: Need help on dax, to satisfy the second condition even if the condition met in the first condition. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4260698#M168857</link>
    <description>&lt;P&gt;Here is I can think for approaching&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Last 15 Days:&lt;BR /&gt;Last15Days =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('YourTable'),&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 15 &amp;amp;&amp;amp; 'YourTable'[Date] &amp;lt;= TODAY()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Last 30 Days:&lt;BR /&gt;Last30Days =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('YourTable'),&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 30 &amp;amp;&amp;amp; 'YourTable'[Date] &amp;lt;= TODAY()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;More than 30 Days:&lt;BR /&gt;MoreThan30Days =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('YourTable'),&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Date] &amp;lt; TODAY() - 30&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;To ensure that the “Last 30 Days” measure includes the full 30-day period and is not affected by the “Last 15 Days” measure, you can use these measures in your visualizations or calculations without them interfering with each other.&lt;/P&gt;&lt;P&gt;If you need to categorize your data into these groups within a single column, you can create a calculated column like this:&lt;/P&gt;&lt;P&gt;DateCategory =&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 15, "Last 15 Days",&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 30, "Last 30 Days",&lt;BR /&gt;'YourTable'[Date] &amp;lt; TODAY() - 30, "More than 30 Days"&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Best Regards&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Saud Ansari&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2024 14:52:30 GMT</pubDate>
    <dc:creator>saud968</dc:creator>
    <dc:date>2024-10-28T14:52:30Z</dc:date>
    <item>
      <title>Need help on dax, to satisfy the second condition even if the condition met in the first condition.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4260615#M168852</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;I'm reaching out for assistance with a requirement that I’ve been working on but haven't been able to fully achieve. Here’s the breakdown of what I need to implement:&lt;/P&gt;&lt;P&gt;The goal is to categorize data based on:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Last 15 days&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Last 30 days&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;More than 30 days (Other than Last 30 Days)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;While I was able to get the &lt;STRONG&gt;Last 15 Days&lt;/STRONG&gt; and &lt;STRONG&gt;Other than Last 30 Days&lt;/STRONG&gt; categories working correctly, I’m encountering an issue with the &lt;STRONG&gt;Last 30 Days&lt;/STRONG&gt;. Instead of displaying data from the full 30-day period, it’s only returning the previous 15 days due to the condition for the Last 15 Days already being met. As a result, my &lt;STRONG&gt;Last 30 Days&lt;/STRONG&gt; category is only showing the 15 days prior to the Last 15 Days, rather than the entire 30-day period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached the report link for reference. Your insights or suggestions on how to structure the logic to capture all 30 days accurately would be greatly appreciated!&lt;BR /&gt;&lt;BR /&gt;&lt;A title="sample report" href="https://app.powerbi.com/groups/me/reports/0d35fcaa-dcad-4f28-a35b-3314c1bfa035?ctid=76a2ae5a-9f00-4f6b-95ed-5d33d77c4d61&amp;amp;pbi_source=linkShare" target="_self"&gt;https://app.powerbi.com/groups/me/reports/0d35fcaa-dcad-4f28-a35b-3314c1bfa035?ctid=76a2ae5a-9f00-4f6b-95ed-5d33d77c4d61&amp;amp;pbi_source=linkShare&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Oct 2024 13:50:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4260615#M168852</guid>
      <dc:creator>Heena_9980400</dc:creator>
      <dc:date>2024-10-28T13:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on dax, to satisfy the second condition even if the condition met in the first condition.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4260698#M168857</link>
      <description>&lt;P&gt;Here is I can think for approaching&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Last 15 Days:&lt;BR /&gt;Last15Days =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('YourTable'),&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 15 &amp;amp;&amp;amp; 'YourTable'[Date] &amp;lt;= TODAY()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Last 30 Days:&lt;BR /&gt;Last30Days =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('YourTable'),&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 30 &amp;amp;&amp;amp; 'YourTable'[Date] &amp;lt;= TODAY()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;More than 30 Days:&lt;BR /&gt;MoreThan30Days =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('YourTable'),&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Date] &amp;lt; TODAY() - 30&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;To ensure that the “Last 30 Days” measure includes the full 30-day period and is not affected by the “Last 15 Days” measure, you can use these measures in your visualizations or calculations without them interfering with each other.&lt;/P&gt;&lt;P&gt;If you need to categorize your data into these groups within a single column, you can create a calculated column like this:&lt;/P&gt;&lt;P&gt;DateCategory =&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 15, "Last 15 Days",&lt;BR /&gt;'YourTable'[Date] &amp;gt;= TODAY() - 30, "Last 30 Days",&lt;BR /&gt;'YourTable'[Date] &amp;lt; TODAY() - 30, "More than 30 Days"&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Best Regards&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Saud Ansari&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 14:52:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4260698#M168857</guid>
      <dc:creator>saud968</dc:creator>
      <dc:date>2024-10-28T14:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on dax, to satisfy the second condition even if the condition met in the first condition.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4261509#M168894</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;&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;
&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;LI-CODE lang="markup"&gt;expected result measure: =
VAR _t =
    ADDCOLUMNS (
        FILTER ( 'calendar', 'calendar'[Date] &amp;lt;= TODAY () ),
        "@sales", CALCULATE ( SUM ( sales[sales] ) )
    )
VAR _category =
    FILTER (
        _t,
        'calendar'[Date]
            &amp;lt;= TODAY () - MIN ( category[min] )
            &amp;amp;&amp;amp; 'calendar'[Date]
                &amp;gt;= TODAY () - MAX ( category[max] )
    )
RETURN
    SUMX ( _category, [@sales] )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 04:18:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4261509#M168894</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-10-29T04:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on dax, to satisfy the second condition even if the condition met in the first condition.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4261518#M168895</link>
      <description>&lt;P&gt;Hi&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;,&lt;BR /&gt;&lt;BR /&gt;Thanks for responding.&lt;BR /&gt;actually im trying to get 3 buttons in a slicer, last 15 days, last 30 days and other than last 30 days.&lt;BR /&gt;&lt;BR /&gt;in this process, the last 30 days&amp;nbsp; arent giving full 30 days date.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;in_last = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;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&lt;SPAN&gt;30&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Last 30 days"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Other than last 30 days"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;hope you got my problem statement.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 04:55:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4261518#M168895</guid>
      <dc:creator>Heena_9980400</dc:creator>
      <dc:date>2024-10-29T04:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on dax, to satisfy the second condition even if the condition met in the first condition.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4261520#M168896</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you for your message, and I am not 100% sure in your case (I think you are trying to create a calculated column), but when trying to use IF DAX function in here, and if the first condition is met, the second condition cannot include the items that are already belong to the first condition.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 05:01:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-on-dax-to-satisfy-the-second-condition-even-if-the/m-p/4261520#M168896</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-10-29T05:01:41Z</dc:date>
    </item>
  </channel>
</rss>

