<?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: Stop running queries on date year and quarter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Stop-running-queries-on-date-year-and-quarter/m-p/4397580#M174600</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="597714" data-lia-user-login="andy421" class="lia-mention lia-mention-user"&gt;andy421&lt;/a&gt;&amp;nbsp;, Try using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;Ratio =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;IF (&lt;BR /&gt;MAX('table1'[DateStamp]) &amp;lt;= DATE(2024, 9, 30),&lt;BR /&gt;DIVIDE(&lt;BR /&gt;('table1'[A] + 'table1'[B]),&lt;BR /&gt;'table1'[C],&lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2025 06:25:59 GMT</pubDate>
    <dc:creator>bhanu_gautam</dc:creator>
    <dc:date>2025-02-06T06:25:59Z</dc:date>
    <item>
      <title>Stop running queries on date year and quarter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Stop-running-queries-on-date-year-and-quarter/m-p/4396856#M174575</link>
      <description>&lt;P&gt;I have a date hierarchy from which I have selected 2 columns Year and Quarter.&lt;BR /&gt;I got 3 measures 2 of which give data at the month level and one only at the quarter level. So I am combining these 3 measures&lt;BR /&gt;and performing a calculation to show data in a table visual in Power BI&lt;/P&gt;&lt;P&gt;I have a ratio like Ratio=A+B/C&lt;BR /&gt;B and C are running totals and A is a value at a point in time&lt;/P&gt;&lt;P&gt;Year Quarter Ratio&lt;BR /&gt;2021 4 0.1&lt;BR /&gt;2022 1 0.2&lt;BR /&gt;2022 2 0.21&lt;BR /&gt;2022 3 0.3&lt;BR /&gt;2022 4 0.28&lt;BR /&gt;2023 1 0.5&lt;BR /&gt;2023 2 0.6&lt;BR /&gt;2023 3 0.6&lt;BR /&gt;2023 4 0.6&lt;BR /&gt;2024 1 1.2&lt;BR /&gt;2024 2 1.3&lt;BR /&gt;2024 3 1.2&lt;BR /&gt;2024 4 0.65&lt;/P&gt;&lt;P&gt;Year and Quarter are displayed from a DateStamp column by dragging the date hierarchy part and removing the months and days.&lt;/P&gt;&lt;P&gt;if I try something like&lt;BR /&gt;Ratio =&lt;BR /&gt;IF (SELECTEDVALUE('table1'[DateStamp]) &amp;lt;=DATE(2024,9,30),&lt;BR /&gt;DIVIDE(&lt;BR /&gt;('table1'[A] +&lt;BR /&gt;'table1'[B]),&lt;BR /&gt;'table1'[C],&lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;I am not expecting the last row to be displayed when I drag the ratio to a table visual&lt;BR /&gt;But still this row is displayed&lt;BR /&gt;2024 4 1.4&lt;/P&gt;&lt;P&gt;if I change to&lt;BR /&gt;if I try something like&lt;BR /&gt;Ratio =&lt;BR /&gt;IF (SELECTEDVALUE('table1'[DateStamp]) &amp;lt;=DATE(2022,1,20),&lt;BR /&gt;DIVIDE(&lt;BR /&gt;('table1'[A] +&lt;BR /&gt;'table1'[B]),&lt;BR /&gt;'table1'[C],&lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;then I get output&lt;/P&gt;&lt;P&gt;Year Quarter Ratio&lt;BR /&gt;2021 4 0.1&lt;BR /&gt;2022 1 0.2&lt;BR /&gt;2023 1 0.5&lt;BR /&gt;2023 3 0.6&lt;BR /&gt;2024 2 1.3&lt;BR /&gt;2024 3 1.2&lt;BR /&gt;2024 4 0.65&lt;/P&gt;&lt;P&gt;So clearly the filtering doesn't seem to work on date and I am not sure why as DateStamp is of Date data type. Also tried Date/Time data type but no luck&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 17:15:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Stop-running-queries-on-date-year-and-quarter/m-p/4396856#M174575</guid>
      <dc:creator>andy421</dc:creator>
      <dc:date>2025-02-05T17:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Stop running queries on date year and quarter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Stop-running-queries-on-date-year-and-quarter/m-p/4397580#M174600</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="597714" data-lia-user-login="andy421" class="lia-mention lia-mention-user"&gt;andy421&lt;/a&gt;&amp;nbsp;, Try using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;Ratio =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;IF (&lt;BR /&gt;MAX('table1'[DateStamp]) &amp;lt;= DATE(2024, 9, 30),&lt;BR /&gt;DIVIDE(&lt;BR /&gt;('table1'[A] + 'table1'[B]),&lt;BR /&gt;'table1'[C],&lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 06:25:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Stop-running-queries-on-date-year-and-quarter/m-p/4397580#M174600</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-02-06T06:25:59Z</dc:date>
    </item>
  </channel>
</rss>

