<?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: Double Slicer Selection and Comparison through Months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3873565#M151307</link>
    <description>&lt;P&gt;Exactly - Power BI prefers Star Schema data models.&amp;nbsp; Snowflakes are tolerated but the guidance is to flatten these.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep in mind that the Power BI user interface includes a Filter Pane. That gives you much more powerful filtering and it frees up screen real estate.&amp;nbsp; "&lt;SPAN&gt;&amp;nbsp;which are what my users are used to.&amp;nbsp;" is a fair argument, but one that needs to be challenged.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Apr 2024 21:36:39 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-04-28T21:36:39Z</dc:date>
    <item>
      <title>Double Slicer Selection and Comparison through Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3871145#M151221</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have two dropdown slicers in my page, that the user uses to select two different years. Then i want to have a matrix that calculates the percentage difference for each month.&lt;/P&gt;&lt;P&gt;My model -that concerns us here- is this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see, i have a DateTable that contains all dates and a CompareDates table that is exactly the same as DateTable. That is so I can have two slicers on the date and also have an inactive relationship.&lt;/P&gt;&lt;P&gt;The problem occurs in the below scenario:&lt;/P&gt;&lt;P&gt;When an Abbr Group doesn't exist in the DateTable period selected by the user but it exists in the CompareDates&amp;nbsp;period selected. For example, Abbr Group "ABC" exists in the year 2023 but it doesn't exist in the year 2024.&lt;/P&gt;&lt;P&gt;Suppose that in 2024 we got these Abbr Groups: "ABC", "DFG" and in 2023 these: "ABC", "DFG", "XYZ"&lt;BR /&gt;The resulting matrix should be:&lt;BR /&gt;&lt;BR /&gt;Abbr Group | sumAvg Availability in Month 2024 | sumAvg Availability in Month 2023 |&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 13&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;|&lt;/P&gt;&lt;P&gt;DFG&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 5&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/P&gt;&lt;P&gt;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 3 &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In the code bellow, I make some Variables that I get from the filter context of the matrix (which has Abbr Group in the columns)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _year = MAX(DateTable[uYear])
VAR _month = MAX(DateTable[uMonth])
VAR _quarter = MAX(DateTable[QuarterText])

VAR abbr_group = MAX('04 Reg'[Abbr Group])
VAR compare_year = MAX(CompareDates[uYear])

VAR currentYear = YEAR(TODAY())
VAR currentMonth = MONTH(TODAY())

VAR currentYearSelected = IF(_year = currentYear, TRUE(), FALSE())
VAR year_denomenator = 
IF(
    currentYearSelected,
    MONTH(TODAY()),
    12
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I use these variables here:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR  avg_avail_per_per_month = 
SUMMARIZE(
    ALL('Units'),
    '04 Reg'[Abbr Group],
    Units[MonthName],
    "Avg Availability in Month", 
    CALCULATE(
        SUM(Units[Avg Availability in Month]), 
        Units[_Year] = compare_year,
        Units[Month Number] &amp;lt;= currentMonth,
        '04 Reg'[Abbr Group] = abbr_group
    )
)
VAR total_of_totals = SUMX(avg_avail_per_per_month, [Avg Availability in Month] / year_denomenator)

RETURN 
total_of_totals&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The problem i suppose, is that the fact that because the year selected from DateTable is 2024, when I use the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR abbr_group = MAX('04 Reg'[Abbr Group])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;code, I don't get the appropriate Abbr Group.&lt;/P&gt;&lt;P&gt;What can I do please?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 13:02:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3871145#M151221</guid>
      <dc:creator>manosjxmaah</dc:creator>
      <dc:date>2024-04-26T13:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Double Slicer Selection and Comparison through Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3871943#M151260</link>
      <description>&lt;P&gt;What you are showing isn't really a data model.&amp;nbsp; You may want to refactor that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider using a single "Between"&amp;nbsp; slicer&amp;nbsp; &amp;nbsp;where you then grab the MIN and MAX values for your comparison years.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 01:26:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3871943#M151260</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-27T01:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Double Slicer Selection and Comparison through Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3873548#M151306</link>
      <description>&lt;P&gt;Thanks for the reply and sorry for the late answer!&lt;BR /&gt;&lt;BR /&gt;What do you mean that it isn't a data model? Do you any articles to suggest that talk about building the datamodel in pbi? I am familiar with star/snowflake/constallation schemas, since I have worked a bit with SSAS, but I don't really know if they are much useful in pbi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I don't really want to use a between slicer, since I include a date hierarchy in my dropdowns which are what my users are used to. Do you have any suggestions on how I can do what i need by adjusting my DAX?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2024 21:20:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3873548#M151306</guid>
      <dc:creator>manosjxmaah</dc:creator>
      <dc:date>2024-04-28T21:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Double Slicer Selection and Comparison through Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3873565#M151307</link>
      <description>&lt;P&gt;Exactly - Power BI prefers Star Schema data models.&amp;nbsp; Snowflakes are tolerated but the guidance is to flatten these.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep in mind that the Power BI user interface includes a Filter Pane. That gives you much more powerful filtering and it frees up screen real estate.&amp;nbsp; "&lt;SPAN&gt;&amp;nbsp;which are what my users are used to.&amp;nbsp;" is a fair argument, but one that needs to be challenged.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2024 21:36:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Double-Slicer-Selection-and-Comparison-through-Months/m-p/3873565#M151307</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-28T21:36:39Z</dc:date>
    </item>
  </channel>
</rss>

