<?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: Date Filtering not working in Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4637956#M177574</link>
    <description>&lt;P&gt;HI This solution works as expected but whe I put +0 then it will not respect the TIme calcualtion filter &amp;amp; instead show all data &amp;amp; as I remove the + 0 then it works fine but is there a way we can put 0 for mar 31, Apr01, Apr2 in the below figure.&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;Data for these 3 dates looks like below as you could see no channel so probably need to figure out a way to handle blank category as it shouldnt be shown on dashboard.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Apr 2025 09:17:35 GMT</pubDate>
    <dc:creator>SUMESHKUMAR22</dc:creator>
    <dc:date>2025-04-04T09:17:35Z</dc:date>
    <item>
      <title>Date Filtering not working in Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633120#M177369</link>
      <description>&lt;P&gt;Hi team,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Im trying to use the below dax measure but its not filtering as per the time calcualtion slicer . why so &amp;amp; how to resolve?&lt;BR /&gt;The last week &amp;amp; this week columns filters from dim date&amp;nbsp; is not coming under filter context.&amp;nbsp;&lt;BR /&gt;Whatever weeks are created here, all that is dynamic using rank function, so it can be simply passed in below measure but its not respecting the This week &amp;amp; Last week column.&amp;nbsp;(Relationship is all good 1-many)&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&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;Rx Granted =
VAR Denominator =
CALCULATE(
SUM(FCT_Operational_KPIs[VALUE1]),
FILTER(FCT_Operational_KPIs, FCT_Operational_KPIs[KPI] = "RX Granted %")
)

VAR Numerator =
CALCULATE(
SUM(FCT_Operational_KPIs[VALUE]),
FILTER(FCT_Operational_KPIs, FCT_Operational_KPIs[KPI] = "RX Granted %")
)

VAR div_ =
IF(
ISBLANK(Denominator) || Denominator = 0,
0,
DIVIDE(Numerator, Denominator, 0)
)

RETURN
IF(
SELECTEDVALUE('Time_Intelligence'[Time Calculation]) = "Last 7 Days",
CALCULATE(
div_,
KEEPFILTERS(FILTER('DIM Date', 'DIM Date'[This Week] = "This Week")) -- Ensures filter propagates
),
IF(
SELECTEDVALUE('Time_Intelligence'[Time Calculation]) = "Last week",
CALCULATE(
div_,
KEEPFILTERS(FILTER('DIM Date', 'DIM Date'[Last Week] = "Last Week")) -- Keeps filter context
)
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 11:43:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633120#M177369</guid>
      <dc:creator>SUMESHKUMAR22</dc:creator>
      <dc:date>2025-04-01T11:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date Filtering not working in Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633170#M177371</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337242" data-lia-user-login="SUMESHKUMAR22" class="lia-mention lia-mention-user"&gt;SUMESHKUMAR22&lt;/a&gt;&amp;nbsp;, Try using&lt;/P&gt;
&lt;P&gt;dax&lt;BR /&gt;Rx Granted =&lt;BR /&gt;VAR Denominator =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(FCT_Operational_KPIs[VALUE1]),&lt;BR /&gt;FILTER(FCT_Operational_KPIs, FCT_Operational_KPIs[KPI] = "RX Granted %")&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR Numerator =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(FCT_Operational_KPIs[VALUE]),&lt;BR /&gt;FILTER(FCT_Operational_KPIs, FCT_Operational_KPIs[KPI] = "RX Granted %")&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR div_ =&lt;BR /&gt;IF(&lt;BR /&gt;ISBLANK(Denominator) || Denominator = 0,&lt;BR /&gt;0,&lt;BR /&gt;DIVIDE(Numerator, Denominator, 0)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;SWITCH(&lt;BR /&gt;SELECTEDVALUE('Time_Intelligence'[Time Calculation]),&lt;BR /&gt;"Last 7 Days",&lt;BR /&gt;CALCULATE(&lt;BR /&gt;div_,&lt;BR /&gt;FILTER('DIM Date', 'DIM Date'[This Week] = "This Week")&lt;BR /&gt;),&lt;BR /&gt;"Last week",&lt;BR /&gt;CALCULATE(&lt;BR /&gt;div_,&lt;BR /&gt;FILTER('DIM Date', 'DIM Date'[Last Week] = "Last Week")&lt;BR /&gt;),&lt;BR /&gt;div_ -- Default case if no match&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 11:59:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633170#M177371</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-04-01T11:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date Filtering not working in Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633242#M177373</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;, I tried this approach earlier but Its the same no change in the filtering showing all dates.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 12:26:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633242#M177373</guid>
      <dc:creator>SUMESHKUMAR22</dc:creator>
      <dc:date>2025-04-01T12:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date Filtering not working in Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633483#M177386</link>
      <description>&lt;P&gt;There's a lot going here, and the images are not readable. Most important thing here is that the way you are using variables here will not work. The calculation is done when the variables are defined, the CALCULATE statements will not alter the value. Try something like below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rx Granted =

IF(SELECTEDVALUE('Time_Intelligence'[Time Calculation]) = "Last 7 Days",
	CALCULATE(DIVIDE(SUM(FCT_Operational_KPIs[VALUE]),SUM(FCT_Operational_KPIs[VALUE]), 0)
		,FCT_Operational_KPIs[KPI] = "RX Granted %"
		,KEEPFILTERS('DIM Date'[This Week] = "This Week"))  -- Ensures filter propagates
	+ 0)
	,IF(SELECTEDVALUE('Time_Intelligence'[Time Calculation]) = "Last week",
		CALCULATE(DIVIDE(SUM(FCT_Operational_KPIs[VALUE]),SUM(FCT_Operational_KPIs[VALUE]), 0)
			,FCT_Operational_KPIs[KPI] = "RX Granted %"		
			,KEEPFILTERS('DIM Date'[Last Week] = "Last Week")) -- Ensures filter propagates
		+ 0)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Apr 2025 14:05:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4633483#M177386</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-04-01T14:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date Filtering not working in Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4637956#M177574</link>
      <description>&lt;P&gt;HI This solution works as expected but whe I put +0 then it will not respect the TIme calcualtion filter &amp;amp; instead show all data &amp;amp; as I remove the + 0 then it works fine but is there a way we can put 0 for mar 31, Apr01, Apr2 in the below figure.&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;Data for these 3 dates looks like below as you could see no channel so probably need to figure out a way to handle blank category as it shouldnt be shown on dashboard.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 09:17:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Filtering-not-working-in-Measure/m-p/4637956#M177574</guid>
      <dc:creator>SUMESHKUMAR22</dc:creator>
      <dc:date>2025-04-04T09:17:35Z</dc:date>
    </item>
  </channel>
</rss>

