<?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: Filtering a calculation group using a slicer with date (weekyear) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3499025#M134115</link>
    <description>&lt;P&gt;I apologize for the oversight. It seems there's a minor issue with your DAX formula. The error you're encountering is because it's having trouble determining a single value for 'WeekYear' in the context of your calculation.&lt;/P&gt;&lt;P&gt;To resolve this issue, you can slightly modify your DAX formula. You should use the VALUES function to retrieve the distinct weekyear values for the selected context. Here's the updated formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SELECTEDMEASURE(),&lt;BR /&gt;YEAR(CalendarTable[Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;WEEKNUM(CalendarTable[Date]) = WEEKNUM(TODAY()),&lt;BR /&gt;FILTER(ALL(CalendarTable), CalendarTable[WeekYear] = SELECTEDVALUE(WeekyearTable[Weekyear]))&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this formula, we're using SELECTEDVALUE(WeekyearTable[Weekyear]) to retrieve the selected weekyear from your slicer. This should resolve the error and correctly filter your calculation based on the selected weekyear.&lt;/P&gt;&lt;P&gt;Make sure that you have a 'WeekyearTable' with the 'Weekyear' column connected to your slicer, and it contains distinct weekyear values corresponding to your 'CalendarTable'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 13:14:06 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2023-10-26T13:14:06Z</dc:date>
    <item>
      <title>Filtering a calculation group using a slicer with date (weekyear)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3498757#M134095</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a model that is using calculation groups: Act,LW,LY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My formulas for the calculation groups are&lt;/P&gt;&lt;PRE&gt;&lt;FONT&gt;&lt;FONT&gt;CALCULATE&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt; &lt;FONT&gt;SELECTEDMEASURE&lt;/FONT&gt;&lt;FONT&gt;()&lt;/FONT&gt;&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt;YEAR&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;YEAR&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;TODAY&lt;/FONT&gt;&lt;FONT&gt;())&lt;/FONT&gt;&lt;FONT&gt; &amp;amp;&amp;amp; &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;TODAY&lt;/FONT&gt;&lt;FONT&gt;())&lt;/FONT&gt;&lt;FONT&gt; - 1&lt;/FONT&gt;&lt;FONT&gt; )&lt;BR /&gt;&lt;FONT&gt;CALCULATE&lt;/FONT&gt;( &lt;FONT&gt;SELECTEDMEASURE&lt;/FONT&gt;()&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt;YEAR&lt;/FONT&gt;(&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;)&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;YEAR&lt;/FONT&gt;(&lt;FONT&gt;TODAY&lt;/FONT&gt;())&lt;FONT&gt; &amp;amp;&amp;amp; &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;(&lt;FONT&gt;CalendarTable[I]&lt;/FONT&gt;)&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;(&lt;FONT&gt;TODAY&lt;/FONT&gt;())&lt;FONT&gt; - 2&lt;/FONT&gt; )&lt;BR /&gt;&lt;FONT&gt;CALCULATE&lt;/FONT&gt;( &lt;FONT&gt;SELECTEDMEASURE&lt;/FONT&gt;()&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt;YEAR&lt;/FONT&gt;(&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;)&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;YEAR&lt;/FONT&gt;(&lt;FONT&gt;TODAY&lt;/FONT&gt;())-1&lt;FONT&gt; &amp;amp;&amp;amp; &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;(&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;)&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;(&lt;FONT&gt;TODAY&lt;/FONT&gt;())&lt;FONT&gt; - 1&lt;/FONT&gt; )&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I have a measure called lets say Sales = sum(salestable[sales])&lt;BR /&gt;&lt;BR /&gt;I've build a matrix visual and dragged the measure under values and calculation groups under columns which works absolutely perfect.&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;&lt;BR /&gt;&lt;BR /&gt;What I would like to be able to do is to create a slicer with the weekyear that would filter my matrix table&lt;BR /&gt;&lt;BR /&gt;So if i was to select current weekyear the actual should be filtered to the actual week but if i select a different weekyear the actual will change based on the weekyear selection.&lt;BR /&gt;&lt;BR /&gt;Any idea if this is possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 12:15:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3498757#M134095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-26T12:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a calculation group using a slicer with date (weekyear)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3498914#M134106</link>
      <description>&lt;P&gt;In Power BI, you can achieve your desired outcome by creating a slicer based on the "WeekYear" and then using that slicer to filter your matrix visual. Here's how you can do it:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a WeekYear Slicer&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a new slicer in your report.&lt;/LI&gt;&lt;LI&gt;Add the "WeekYear" field to the Values section of the slicer.&lt;/LI&gt;&lt;LI&gt;Customize the slicer as needed to make it user-friendly.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Update your Calculation Groups&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;You already have calculation groups for "Act," "LW" (Last Week), and "LY" (Last Year). You'll need to update these calculations to consider the selected "WeekYear" in the slicer. You can use the FILTER function to achieve this. Here's an example of how to modify your calculation groups:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;For "Act" (Actual):&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SELECTEDMEASURE(),&lt;BR /&gt;YEAR(CalendarTable[Date]) = YEAR(TODAY()) &amp;amp;&amp;amp; WEEKNUM(CalendarTable[Date]) = WEEKNUM(TODAY()),&lt;BR /&gt;FILTER(ALL('YourDateTable'), 'YourDateTable'[WeekYear] = SELECTEDVALUE('YourWeekYearSlicer'[WeekYear]))&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For "LW" (Last Week):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(&lt;BR /&gt;SELECTEDMEASURE(),&lt;BR /&gt;YEAR(CalendarTable[Date]) = YEAR(TODAY()) &amp;amp;&amp;amp; WEEKNUM(CalendarTable[Date]) = WEEKNUM(TODAY()) - 1,&lt;BR /&gt;FILTER(ALL('YourDateTable'), 'YourDateTable'[WeekYear] = SELECTEDVALUE('YourWeekYearSlicer'[WeekYear]))&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For "LY" (Last Year):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(&lt;BR /&gt;SELECTEDMEASURE(),&lt;BR /&gt;YEAR(CalendarTable[Date]) = YEAR(TODAY()) - 1 &amp;amp;&amp;amp; WEEKNUM(CalendarTable[Date]) = WEEKNUM(TODAY()) - 1,&lt;BR /&gt;FILTER(ALL('YourDateTable'), 'YourDateTable'[WeekYear] = SELECTEDVALUE('YourWeekYearSlicer'[WeekYear]))&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Replace 'YourDateTable' with the name of your date table, and 'YourWeekYearSlicer' with the name of your WeekYear slicer.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Use the WeekYear Slicer&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Place the WeekYear slicer on your report canvas.&lt;/LI&gt;&lt;LI&gt;When you select a specific WeekYear from the slicer, your matrix visual should automatically update based on the WeekYear selection, reflecting the calculations for the selected WeekYear.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This way, your matrix visual will dynamically respond to the WeekYear slicer's selection, and your calculations will take the selected WeekYear into account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 12:32:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3498914#M134106</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-10-26T12:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a calculation group using a slicer with date (weekyear)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3498963#M134109</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp; thank you for your quick response, but I am getting the following error&lt;BR /&gt;&lt;BR /&gt;Expression: A single value for column 'WeekYear' in table 'CalendarTable' cannot be determined&lt;BR /&gt;&lt;BR /&gt;when using this formula&lt;/P&gt;&lt;PRE&gt;&lt;FONT&gt;&lt;FONT&gt;CALCULATE&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; SELECTEDMEASURE&lt;/FONT&gt;&lt;FONT&gt;()&lt;/FONT&gt;&lt;FONT&gt;,&lt;/FONT&gt;&lt;FONT&gt; YEAR&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;YEAR&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;TODAY&lt;/FONT&gt;&lt;FONT&gt;())&lt;/FONT&gt;&lt;FONT&gt; &amp;amp;&amp;amp; &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt; = &lt;/FONT&gt;&lt;FONT&gt;WEEKNUM&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;TODAY&lt;/FONT&gt;&lt;FONT&gt;())&lt;/FONT&gt;&lt;FONT&gt;,&lt;/FONT&gt;&lt;FONT&gt; FILTER&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;ALL&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;CalendarTable[Date]&lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt;, CalendarTable[WeekYear] = &lt;/FONT&gt;&lt;FONT&gt;SELECTEDVALUE&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;[WeekNum]&lt;/FONT&gt;&lt;FONT&gt;)) )&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WeekYear is a column in my CalendarTable&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 12:58:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3498963#M134109</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-26T12:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a calculation group using a slicer with date (weekyear)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3499005#M134114</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;, apologies that was my mistake, I fixed the formula but now it is returning blank&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 13:06:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3499005#M134114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-26T13:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a calculation group using a slicer with date (weekyear)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3499025#M134115</link>
      <description>&lt;P&gt;I apologize for the oversight. It seems there's a minor issue with your DAX formula. The error you're encountering is because it's having trouble determining a single value for 'WeekYear' in the context of your calculation.&lt;/P&gt;&lt;P&gt;To resolve this issue, you can slightly modify your DAX formula. You should use the VALUES function to retrieve the distinct weekyear values for the selected context. Here's the updated formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SELECTEDMEASURE(),&lt;BR /&gt;YEAR(CalendarTable[Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;WEEKNUM(CalendarTable[Date]) = WEEKNUM(TODAY()),&lt;BR /&gt;FILTER(ALL(CalendarTable), CalendarTable[WeekYear] = SELECTEDVALUE(WeekyearTable[Weekyear]))&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this formula, we're using SELECTEDVALUE(WeekyearTable[Weekyear]) to retrieve the selected weekyear from your slicer. This should resolve the error and correctly filter your calculation based on the selected weekyear.&lt;/P&gt;&lt;P&gt;Make sure that you have a 'WeekyearTable' with the 'Weekyear' column connected to your slicer, and it contains distinct weekyear values corresponding to your 'CalendarTable'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 13:14:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3499025#M134115</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-10-26T13:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a calculation group using a slicer with date (weekyear)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3499169#M134135</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;, THANK YOU!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to make a few adjustments to the formula you provided and change my CalendarTable a bit but now it works perfectly!&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 14:09:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-calculation-group-using-a-slicer-with-date-weekyear/m-p/3499169#M134135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-26T14:09:24Z</dc:date>
    </item>
  </channel>
</rss>

