<?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 query as a column for date between 2W and 1M, 1M and 3M, etc... in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3062241#M105876</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me on how to get number of users between the date range of 2week and 1Month, 1Month and 3 Month, 3Month and 1 Year others as more than 1 year as abar chart.&lt;/P&gt;&lt;P&gt;I need a query for date ranges as mentioned above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Sun, 05 Feb 2023 13:26:08 GMT</pubDate>
    <dc:creator>Shine_456</dc:creator>
    <dc:date>2023-02-05T13:26:08Z</dc:date>
    <item>
      <title>Dax query as a column for date between 2W and 1M, 1M and 3M, etc...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3062241#M105876</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me on how to get number of users between the date range of 2week and 1Month, 1Month and 3 Month, 3Month and 1 Year others as more than 1 year as abar chart.&lt;/P&gt;&lt;P&gt;I need a query for date ranges as mentioned above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 13:26:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3062241#M105876</guid>
      <dc:creator>Shine_456</dc:creator>
      <dc:date>2023-02-05T13:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dax query as a column for date between 2W and 1M, 1M and 3M, etc...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3062632#M105916</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="435561" data-lia-user-login="Shine_456" class="lia-mention lia-mention-user"&gt;Shine_456&lt;/a&gt;&amp;nbsp; I would suggest doing this in Power Query rather than DAX.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Click Transform Data, Add Column &amp;gt; Custom Column.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then put a code similar to this (replace [Date] with the name of your date column and replace the ranges and text with what you want).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if [Date] &amp;gt;= Date.AddWeeks( Date.From( DateTime.FixedLocalNow() ) , -2) then "2 weeks" &lt;BR /&gt;else if [Date] &amp;gt;= Date.AddMonths( Date.From( DateTime.FixedLocalNow() ) , -1) then "2 weeks - 1 month" &lt;BR /&gt;else if [Date] &amp;gt;= Date.AddMonths( Date.From( DateTime.FixedLocalNow() ) , -3) then "1 - 3 months" &lt;BR /&gt;else if [Date] &amp;gt;= Date.AddMonths( Date.From( DateTime.FixedLocalNow() ) , -12) then "3 - 12 months" &lt;BR /&gt;else "Older than 1 year"&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>Mon, 06 Feb 2023 01:01:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3062632#M105916</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2023-02-06T01:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dax query as a column for date between 2W and 1M, 1M and 3M, etc...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3065292#M106112</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="227497" data-lia-user-login="AllisonKennedy" class="lia-mention lia-mention-user"&gt;AllisonKennedy&lt;/a&gt;&amp;nbsp;. Your query worked.&lt;/P&gt;&lt;P&gt;I had some null in date. How to replace them from above query?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 04:23:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3065292#M106112</guid>
      <dc:creator>Shine_456</dc:creator>
      <dc:date>2023-02-07T04:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dax query as a column for date between 2W and 1M, 1M and 3M, etc...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3070238#M106506</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="435561" data-lia-user-login="Shine_456" class="lia-mention lia-mention-user"&gt;Shine_456&lt;/a&gt;&amp;nbsp;, what do you want to replace the null with?&lt;BR /&gt;&lt;BR /&gt;you can either do this as a separate step first using 'replace values' and type 'null' in the value to find/replace box, or you can add a line at the start of the new column query:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if [Date] = null then "NA"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;else if [Date] &amp;gt;= Date.AddWeeks( Date.From( DateTime.FixedLocalNow() ) , -2) then "2 weeks"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else if [Date] &amp;gt;= Date.AddMonths( Date.From( DateTime.FixedLocalNow() ) , -1) then "2 weeks - 1 month"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else if [Date] &amp;gt;= Date.AddMonths( Date.From( DateTime.FixedLocalNow() ) , -3) then "1 - 3 months"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else if [Date] &amp;gt;= Date.AddMonths( Date.From( DateTime.FixedLocalNow() ) , -12) then "3 - 12 months"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else "Older than 1 year"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 21:03:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-as-a-column-for-date-between-2W-and-1M-1M-and-3M-etc/m-p/3070238#M106506</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2023-02-08T21:03:17Z</dc:date>
    </item>
  </channel>
</rss>

