<?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: How to use different measures based on selected date range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/3169221#M114172</link>
    <description>&lt;P&gt;Good Day&amp;nbsp;&lt;SPAN&gt;tt_and&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;Thank you for assisting. Kindly note that the switch formula doesn't return the calandar table, screen dump below to show what I am getting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Apr 2023 11:49:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-03T11:49:56Z</dc:date>
    <item>
      <title>How to use different measures based on selected date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/3157927#M113321</link>
      <description>&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been struggling for weeks now. I need help please on using dax, I have 4 measures one for each quarter in the year. I am struggling to figure out how can One use the a certian measure based on the selected date range. eg: If user selects 01 Jan 2023-15 Jan 2023 measure 1 should apply for that period or the user selects 01 April 2023 - 15 April 2023 measure 2 should apply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would really appreciate the assistance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Itu&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 08:18:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/3157927#M113321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-28T08:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use different measures based on selected date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/3160236#M113462</link>
      <description>&lt;P&gt;Hi. I assume you have a date table that's used for slicing on dates. If you add a column to the date table defining each period on each date row, you can use this with a switch in a base measure.&lt;BR /&gt;&lt;BR /&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;Base measure = 
switch(
    calendar[Period],
    1, [Measure1],
    2, [Measure2],
    3, [Measure3],
    4, [Measure4]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 08:09:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/3160236#M113462</guid>
      <dc:creator>tt_and</dc:creator>
      <dc:date>2023-03-29T08:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use different measures based on selected date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/3169221#M114172</link>
      <description>&lt;P&gt;Good Day&amp;nbsp;&lt;SPAN&gt;tt_and&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;Thank you for assisting. Kindly note that the switch formula doesn't return the calandar table, screen dump below to show what I am getting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 11:49:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/3169221#M114172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-03T11:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use different measures based on selected date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/4141161#M164572</link>
      <description>&lt;P&gt;Building on the approach proposed by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="534104" data-lia-user-login="tt_and" class="lia-mention lia-mention-user"&gt;tt_and&lt;/a&gt;, you can also create a measure. The trick is to utilize a vartual table within the measure to generate the total of all the different measures you are switching between.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Base measure =
VAR __table1 =
    ADDCOLUMNS (
        calendar,
        "@composite_measure",
            SWITCH (
                calendar[Period],
                1, [Measure1],
                2, [Measure2],
                3, [Measure3],
                4, [Measure4]
            )
    )
RETURN
    SUMX ( __table1, [@composite_measure] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 18:21:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-different-measures-based-on-selected-date-range/m-p/4141161#M164572</guid>
      <dc:creator>ferial_coder</dc:creator>
      <dc:date>2024-09-09T18:21:52Z</dc:date>
    </item>
  </channel>
</rss>

