<?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: Create formula switch measure depending on year selected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475099#M132736</link>
    <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let say we are in onctober 2023 and that 2021,2022,2023 are selected The required values are Salestable1 in the column 2023 and Salestable2 in the column 2021 and 2022.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(If we are in March 2023 in all the 3 columns I have to have Salestable2 )&lt;/P&gt;&lt;P&gt;Can you suggest me a formula?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 08:13:18 GMT</pubDate>
    <dc:creator>Anne14</dc:creator>
    <dc:date>2023-10-13T08:13:18Z</dc:date>
    <item>
      <title>Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3460386#M131991</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help to create a dynamic measure which can be switched in a table automaticly by the user year selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the details: I have 2 sorce tables which have the same column "Products" and a column "Year" and for each table there is 1 measure column SalesTable1 and 1 measure column SalesTable2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So on the page I want to display a slicer Year selection and a simple table with Product as a dimension and Sales like a measure but here is the conditions:&lt;/P&gt;&lt;P&gt;If Today we are in the year 2023 so If the user chose 2022,2021,2020 etc I need to display SalesTable1 and If the user chose the current year (2023) I need to display SalesTable2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next year if today we are 01/05/2024&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the Year chosen in the slicer is .....2021or 2022 or 2023 - I have to display SalesTable1 and if the year chosen is 2024 - SalesTable2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if today we are in the range between 01/01/2024 and 30/04/2024&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the year till 2022 - SalesTable1 and for 2023 and 2024 - SalesTable2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help Hope it is clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 20:50:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3460386#M131991</guid>
      <dc:creator>Anne14</dc:creator>
      <dc:date>2023-10-04T20:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3460845#M132008</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366142" data-lia-user-login="Anne14" class="lia-mention lia-mention-user"&gt;Anne14&lt;/a&gt;&amp;nbsp;, use either if statement or switch statement in a new measure where if the year matches year(today()),i.e. 2023 it gives salesTable2 else salesTable1&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 09:36:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3460845#M132008</guid>
      <dc:creator>ChiragGarg2512</dc:creator>
      <dc:date>2023-10-05T09:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3461263#M132025</link>
      <description>&lt;P&gt;ok thanks but there is the condition about what month we are... il it is before mai or after that...&lt;/P&gt;&lt;P&gt;Can you give me an example for the full expression formula please ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 08:14:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3461263#M132025</guid>
      <dc:creator>Anne14</dc:creator>
      <dc:date>2023-10-05T08:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3461393#M132031</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366142" data-lia-user-login="Anne14" class="lia-mention lia-mention-user"&gt;Anne14&lt;/a&gt;&amp;nbsp;Add the condition where if it's not this year it checks whether it is year(today()) - 1 and month(today()) &amp;lt; 5.&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&lt;/SPAN&gt; &lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; values('TableName'[Year])&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= &lt;/SPAN&gt;&lt;SPAN&gt;year(today())&lt;/SPAN&gt;&lt;SPAN&gt;, [SalesTable2]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;values('TableName'[Year])&lt;/SPAN&gt;&lt;SPAN&gt; = year(today())-1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(today()&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;, [SalesTable2]&lt;/SPAN&gt;&lt;SPAN&gt;, [SalesTable1]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;This will return error if nothing is selected.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank You.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Oct 2023 10:00:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3461393#M132031</guid>
      <dc:creator>ChiragGarg2512</dc:creator>
      <dc:date>2023-10-05T10:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3473941#M132683</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your answer. I used the If function instead of switch and it is ok but I have two types of pages. One page where I have a year slicer so I can select 2021 or 2022 or 2023 etc and on the table I have the product and Sales: here all works fine but I have another page where I have a pivot table with product as line and year as column (always sales as measure).&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I try to make this table I have error message (as you mentionned that&amp;nbsp;&lt;SPAN&gt;This will return error if nothing is selected)&lt;/SPAN&gt;&amp;nbsp;that&amp;nbsp;&lt;SPAN&gt;columns contain multiples where 1 was expected which is normal because I try to select 2 or more years and the IF is waiting for one... How I can make another formula with the same function but who is showing the result for the 2 Salestable1 and Salestable2 in the same table&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'table1'&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;year&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;today&lt;/SPAN&gt;&lt;SPAN&gt;()) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;today&lt;/SPAN&gt;&lt;SPAN&gt;()) &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Salestable1]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Salestable2]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;Here is the result I expect&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2023&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Product 1&amp;nbsp;Salestable1&amp;nbsp;Salestable1&amp;nbsp;Salestable2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Product2&amp;nbsp; &amp;nbsp;Salestable1&amp;nbsp;Salestable1&amp;nbsp;Salestable2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks again&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 16:26:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3473941#M132683</guid>
      <dc:creator>Anne14</dc:creator>
      <dc:date>2023-10-12T16:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3474863#M132729</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366142" data-lia-user-login="Anne14" class="lia-mention lia-mention-user"&gt;Anne14&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'table1'&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt;) =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;year&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;today&lt;/SPAN&gt;&lt;SPAN&gt;()) &amp;amp;&amp;amp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;today&lt;/SPAN&gt;&lt;SPAN&gt;()) &amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[Salestable1]&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[Salestable2]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This will give SalesTable1 for october 2023.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Use an isfiltered function for [year], also specify what is the required value when two years are selected.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 06:11:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3474863#M132729</guid>
      <dc:creator>ChiragGarg2512</dc:creator>
      <dc:date>2023-10-13T06:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475099#M132736</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let say we are in onctober 2023 and that 2021,2022,2023 are selected The required values are Salestable1 in the column 2023 and Salestable2 in the column 2021 and 2022.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(If we are in March 2023 in all the 3 columns I have to have Salestable2 )&lt;/P&gt;&lt;P&gt;Can you suggest me a formula?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 08:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475099#M132736</guid>
      <dc:creator>Anne14</dc:creator>
      <dc:date>2023-10-13T08:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475187#M132744</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366142" data-lia-user-login="Anne14" class="lia-mention lia-mention-user"&gt;Anne14&lt;/a&gt;&amp;nbsp;, This measure should work but introduce a date column somehow, because for multiple selection on slicer there needs to be a distinction. If the table visual just has productName and measure, then multiple selection is going to create a problem. In matrix visual, set rows as product, columns as year and values as measures.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 08:57:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475187#M132744</guid>
      <dc:creator>ChiragGarg2512</dc:creator>
      <dc:date>2023-10-13T08:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475302#M132756</link>
      <description>&lt;P&gt;that is what I did : try the matrix visual but I have the error t&lt;SPAN&gt;hat&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;columns contain multiples where 1 was expected&amp;nbsp;when I select 2 or more years in the slicer &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I think the IF function will always require one selected value.. I need some other solution&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 10:02:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475302#M132756</guid>
      <dc:creator>Anne14</dc:creator>
      <dc:date>2023-10-13T10:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create formula switch measure depending on year selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475467#M132763</link>
      <description>&lt;P&gt;if year is part of column fields, there would be no need of slicer. If slicer is needed, make a field parameter.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 11:33:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-formula-switch-measure-depending-on-year-selected/m-p/3475467#M132763</guid>
      <dc:creator>ChiragGarg2512</dc:creator>
      <dc:date>2023-10-13T11:33:31Z</dc:date>
    </item>
  </channel>
</rss>

