<?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: Different results dependent on slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2565384#M73080</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398388" data-lia-user-login="LCCKevO" class="lia-mention lia-mention-user"&gt;LCCKevO&lt;/a&gt; , the way to deal with any nonstandard period &lt;/P&gt;
&lt;P&gt;Say on YYYYMM&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Period Rank = RANKX(all(Period),Period[year period],,ASC,Dense)&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Period Rank = RANKX(all(Period),Period[Period Start Date],,ASC,Dense)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure &lt;BR /&gt;This Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))&lt;BR /&gt;Last Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period, &lt;BR /&gt;Custom Period till date: &lt;A href="https://youtu.be/aU2aKbnHuWs&amp;amp;t=145s" target="_blank"&gt;https://youtu.be/aU2aKbnHuWs&amp;amp;t=145s&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 03:11:34 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-06-08T03:11:34Z</dc:date>
    <item>
      <title>Different results dependent on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2564483#M73030</link>
      <description>&lt;P&gt;I have a built financial reports that includes measures for "variance" and "change in variance from last period". The report has slicers for "Financial Year" and "Period". Most of the time these work how I want them to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when "Period" is filtered to "1" the "change in variance from last period" calculates as the difference between the last value for the previous year, and the first of the selected year. It should just be the "variance" figure, as at the start of the year there is no variance. I thought the way around this was to use an if function, but when I've tried it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX I've tried so far, is as below:&lt;/P&gt;&lt;P&gt;= If ([Period] = "1", "Variance", "Change in Variance")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on how I can get this to work?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 15:25:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2564483#M73030</guid>
      <dc:creator>LCCKevO</dc:creator>
      <dc:date>2022-06-07T15:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Different results dependent on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2565384#M73080</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398388" data-lia-user-login="LCCKevO" class="lia-mention lia-mention-user"&gt;LCCKevO&lt;/a&gt; , the way to deal with any nonstandard period &lt;/P&gt;
&lt;P&gt;Say on YYYYMM&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Period Rank = RANKX(all(Period),Period[year period],,ASC,Dense)&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Period Rank = RANKX(all(Period),Period[Period Start Date],,ASC,Dense)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure &lt;BR /&gt;This Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))&lt;BR /&gt;Last Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period, &lt;BR /&gt;Custom Period till date: &lt;A href="https://youtu.be/aU2aKbnHuWs&amp;amp;t=145s" target="_blank"&gt;https://youtu.be/aU2aKbnHuWs&amp;amp;t=145s&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 03:11:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2565384#M73080</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-06-08T03:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Different results dependent on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2571211#M73437</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398388" data-lia-user-login="LCCKevO" class="lia-mention lia-mention-user"&gt;LCCKevO&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;In order to give you a suitable solution, could you please provide some &lt;STRONG&gt;sample data&lt;/STRONG&gt; in your tables (&lt;EM&gt;&lt;STRONG&gt;exclude &lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;sensitive &lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/EM&gt;) with &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt; &lt;/FONT&gt;format and your &lt;STRONG&gt;expected result&lt;/STRONG&gt; with backend logic and special examples. &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;It is better&lt;/FONT&gt;&lt;/STRONG&gt; if you can share a &lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt; &lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, please review the following links and check if they can give you some insights or direction.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=tljRYGz15PA" target="_self"&gt;Different Measures Based on Slicer Selection in Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.fourmoo.com/2019/05/08/dax-calculating-the-difference-between-2-selections-on-a-slicer/" target="_self"&gt;DAX – Calculating the difference between 2 selections on a Slicer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Difference-between-results-based-on-slicer-selection/m-p/2221288" target="_self"&gt;Difference between results based on slicer selection&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Variance from Selected Companies = 
VAR summary =
    ADDCOLUMNS (ALLSELECTED(Item_Table[Company]), "cCompany", RANKX(ALLSELECTED(Item_Table[Company]),[Grand Total]))
VAR S1=
    CALCULATE([Grand Total],FILTER(summary,[cCompany]=1))
VAR S2=
    CALCULATE([Grand Total],FILTER(summary,[cCompany]=2))
Return
S1-S2&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 08:40:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2571211#M73437</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-10T08:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Different results dependent on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2574543#M73655</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The video on Different Measures based on Slicer Selection in Power BI provided an answer to my problem. This is going to be very useful. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 08:51:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-dependent-on-slicer/m-p/2574543#M73655</guid>
      <dc:creator>LCCKevO</dc:creator>
      <dc:date>2022-06-13T08:51:15Z</dc:date>
    </item>
  </channel>
</rss>

