<?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 Dax - switch function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1435393#M26813</link>
    <description>&lt;P&gt;hi all , DAX is A new language for me (:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have column "postion name" &amp;amp; "Actual amount" most of&amp;nbsp; them come directly from the DB and some are calculated&lt;/P&gt;&lt;P&gt;like 'NRI' is calculation of "GRI" + 'LRI'&lt;/P&gt;&lt;P&gt;when i use&amp;nbsp;SWITCH(TRUE() function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i use this option:&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;return&lt;BR /&gt;SWITCH(TRUE(),&lt;BR /&gt;MAX('9 - Controling'[POSITIONS_NAME])="NRI" , CALCULATE(sum('9 - Controling'[Actual Amount]),'9 - Controling'[POSITIONS_NAME])="GRI")&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;I received this error message :&amp;nbsp;dax comparison do not support comparing values of type number with value text&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;sinayha&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2020 08:38:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-15T08:38:01Z</dc:date>
    <item>
      <title>Dax - switch function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1435393#M26813</link>
      <description>&lt;P&gt;hi all , DAX is A new language for me (:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have column "postion name" &amp;amp; "Actual amount" most of&amp;nbsp; them come directly from the DB and some are calculated&lt;/P&gt;&lt;P&gt;like 'NRI' is calculation of "GRI" + 'LRI'&lt;/P&gt;&lt;P&gt;when i use&amp;nbsp;SWITCH(TRUE() function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i use this option:&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;return&lt;BR /&gt;SWITCH(TRUE(),&lt;BR /&gt;MAX('9 - Controling'[POSITIONS_NAME])="NRI" , CALCULATE(sum('9 - Controling'[Actual Amount]),'9 - Controling'[POSITIONS_NAME])="GRI")&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;I received this error message :&amp;nbsp;dax comparison do not support comparing values of type number with value text&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;sinayha&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 08:38:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1435393#M26813</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-15T08:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dax - switch function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1435918#M26823</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, let's format the measure first in order to see it clearly&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= SWITCH (
    TRUE (),
    MAX ( '9 - Controling'[POSITIONS_NAME] ) = "NRI",
        CALCULATE (
            SUM ( '9 - Controling'[Actual Amount] ),
            '9 - Controling'[POSITIONS_NAME]
        ) = "GRI"
)&lt;/LI-CODE&gt;&lt;P&gt;the CALCULATE( SUM (...) ) part returns a number and then compared with "GRI", which results in an error.&lt;/P&gt;&lt;P&gt;btw, I'm afraid this par is an error-prone expression.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE (
            SUM ( '9 - Controling'[Actual Amount] ),
            '9 - Controling'[POSITIONS_NAME]
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 11:47:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1435918#M26823</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2020-10-15T11:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dax - switch function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1436016#M26827</link>
      <description>&lt;P&gt;Thanks so much for your response.&lt;/P&gt;&lt;P&gt;I realized what I did wrong (:&lt;/P&gt;&lt;P&gt;NRI &amp;amp; GRI in the same level so when i did&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MAX ( '9 - Controling'[POSITIONS_NAME] ) = "NRI",&lt;/PRE&gt;&lt;P&gt;Because of the filter the result will be 0 for GRI.&lt;/P&gt;&lt;P&gt;So,, i add calc for 'nri'&lt;/P&gt;&lt;P&gt;NRI Actual 2019 =&lt;BR /&gt;VAR maxMonthSelection = SELECTEDVALUE('8 - Date'[MonthNameShort])&lt;BR /&gt;var maxyear = DATEVALUE(CONCATENATE(CONCATENATE("2019/",'0 - Measure'[check month]),"/01"))&lt;BR /&gt;return&lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;'9 - Controling' ,&lt;BR /&gt;'9 - Controling'[Period Date] = maxyear &amp;amp;&amp;amp;&lt;BR /&gt;'9 - Controling'[SUBGROUPS1_NAME]= "GRI"&lt;BR /&gt;)&lt;BR /&gt;,'9 - Controling'[Actual Amount])&lt;BR /&gt;+ SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;'9 - Controling' ,&lt;BR /&gt;'9 - Controling'[Period Date] = maxyear &amp;amp;&amp;amp;&lt;BR /&gt;'9 - Controling'[SUBGROUPS1_NAME]= "Rent-free"&lt;BR /&gt;)&lt;BR /&gt;,'9 - Controling'[Actual Amount]).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now the display bothers me (: . Is it possible to add a column that is for the calculation to look like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 12:49:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1436016#M26827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-15T12:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dax - switch function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1436107#M26836</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, frankly speaking, I can bearly help troubleshoot such a long DAX expression without any underlying data model. It would be way much easier if you attach a dummy file with some mockup data.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 13:15:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-switch-function/m-p/1436107#M26836</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2020-10-15T13:15:48Z</dc:date>
    </item>
  </channel>
</rss>

