<?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 SWITCH function and time intelligence in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-function-and-time-intelligence/m-p/317026#M156481</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I was hoping you guys could help me with this...&lt;/P&gt;&lt;P&gt;I'm building a KPI Dashboard, and I need to create a button (with the SWITCH function, i'm guessing), that changes the values between Current Month x YTD x Last Year on Budget and Actual on the charts.&lt;/P&gt;&lt;P&gt;I've tried inumerous ways of doing it, but my problem always seems to be that the selector won't work!&lt;/P&gt;&lt;P&gt;It just gives me the same number, wether I select YTD, Actual or Last Year.&lt;/P&gt;&lt;P&gt;I have also tried searching for this on this forum, but I can't seem to find anything!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The measures I'm using:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Actual = CALCULATE([SumAmount2];Scenario[ScenarioName]="Actual")&lt;BR /&gt;ActualQTD = CALCULATE([Actual]; DATESQTD(Calendar[Date]))&lt;BR /&gt;ActualYTD = CALCULATE([Actual]; DATESYTD(Calendar[Date]))&lt;/P&gt;&lt;P&gt;same for budget.&lt;/P&gt;&lt;P&gt;And the switch function:&lt;BR /&gt;Actual Select = SWITCH([SelectorNum]&lt;BR /&gt;; 1; [Actual]&lt;BR /&gt;; 2; [ActualQTD]&lt;BR /&gt;; 3; [ActualYTD]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This selector Num is a measure:&lt;/P&gt;&lt;P&gt;SelectorNum = MIN(SelectMeasure[SelectorNumber])&lt;/P&gt;&lt;P&gt;The Selector Number is a standart table to use for SWITCH functions, which includes:&lt;/P&gt;&lt;P&gt;Selector Selector Number&lt;BR /&gt;Current 1&lt;BR /&gt;QTD 2&lt;BR /&gt;YTD 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be much aprreciated!! I have been struggling with this issue for a while now, and no one in my company knows anything about Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2017 23:16:13 GMT</pubDate>
    <dc:creator>Marjss</dc:creator>
    <dc:date>2017-12-04T23:16:13Z</dc:date>
    <item>
      <title>SWITCH function and time intelligence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-function-and-time-intelligence/m-p/317026#M156481</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I was hoping you guys could help me with this...&lt;/P&gt;&lt;P&gt;I'm building a KPI Dashboard, and I need to create a button (with the SWITCH function, i'm guessing), that changes the values between Current Month x YTD x Last Year on Budget and Actual on the charts.&lt;/P&gt;&lt;P&gt;I've tried inumerous ways of doing it, but my problem always seems to be that the selector won't work!&lt;/P&gt;&lt;P&gt;It just gives me the same number, wether I select YTD, Actual or Last Year.&lt;/P&gt;&lt;P&gt;I have also tried searching for this on this forum, but I can't seem to find anything!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The measures I'm using:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Actual = CALCULATE([SumAmount2];Scenario[ScenarioName]="Actual")&lt;BR /&gt;ActualQTD = CALCULATE([Actual]; DATESQTD(Calendar[Date]))&lt;BR /&gt;ActualYTD = CALCULATE([Actual]; DATESYTD(Calendar[Date]))&lt;/P&gt;&lt;P&gt;same for budget.&lt;/P&gt;&lt;P&gt;And the switch function:&lt;BR /&gt;Actual Select = SWITCH([SelectorNum]&lt;BR /&gt;; 1; [Actual]&lt;BR /&gt;; 2; [ActualQTD]&lt;BR /&gt;; 3; [ActualYTD]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This selector Num is a measure:&lt;/P&gt;&lt;P&gt;SelectorNum = MIN(SelectMeasure[SelectorNumber])&lt;/P&gt;&lt;P&gt;The Selector Number is a standart table to use for SWITCH functions, which includes:&lt;/P&gt;&lt;P&gt;Selector Selector Number&lt;BR /&gt;Current 1&lt;BR /&gt;QTD 2&lt;BR /&gt;YTD 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be much aprreciated!! I have been struggling with this issue for a while now, and no one in my company knows anything about Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 23:16:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-function-and-time-intelligence/m-p/317026#M156481</guid>
      <dc:creator>Marjss</dc:creator>
      <dc:date>2017-12-04T23:16:13Z</dc:date>
    </item>
  </channel>
</rss>

