<?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: DAX Switch True in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813391#M5301</link>
    <description>&lt;P&gt;Hi, here's what u can do :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Test = &lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;VAR R1=CALCULATE(count(Check[Reason 1]);Check[Reason 1]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR R2=CALCULATE(count(Check[Reason 2]);Check[Reason 2]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR R3=CALCULATE(count(Check[Reason 3]);Check[Reason 3]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR R4=CALCULATE(count(Check[Reason 4]);Check[Reason 4]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;"Reason1 = " &amp;amp; R1 &amp;amp; " ; Reason2 = " &amp;amp; R2 &amp;amp; " ; Reason3 = " &amp;amp; R3 &amp;amp; " ; Reason4 = " &amp;amp; R4&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 08:07:26 GMT</pubDate>
    <dc:creator>Rahal</dc:creator>
    <dc:date>2019-10-09T08:07:26Z</dc:date>
    <item>
      <title>DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/812890#M5284</link>
      <description>&lt;P&gt;DAX experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how my data is set up:&lt;/P&gt;&lt;P&gt;ID:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reason 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reason 2&amp;nbsp; &amp;nbsp; &amp;nbsp; Reason 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reason 4&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp; Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Incorrect&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp; Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to do is get a count of how many times each reason contains incorrect.&lt;/P&gt;&lt;P&gt;So Reason1 = 1; Reason2 = 2; Reason3 = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I am doing a Switch True:&lt;/P&gt;&lt;PRE&gt;TEST = SWITCH(TRUE(),
    'Check'[Reason1] = "INCORRECT","Reason1",
    'Check'[Reason2] = "INCORRECT","Reason2",
    'Check'[Reason3] = "INCORRECT","Reason3",&lt;/PRE&gt;&lt;P&gt;This is wrong because it is saying only when reason 1 is incorrect then count the number of times reason 2 is incorrect. I basically need this to be calculated independent of what reason 1 was marked.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 21:33:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/812890#M5284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-08T21:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/812921#M5289</link>
      <description>&lt;P&gt;try changing your data to this format:&lt;/P&gt;&lt;P&gt;ID:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reason&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &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;Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&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; Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Incorrect&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&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; Incorrect&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp;Correct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it will make your calculation much easier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 22:15:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/812921#M5289</guid>
      <dc:creator>kentyler</dc:creator>
      <dc:date>2019-10-08T22:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813391#M5301</link>
      <description>&lt;P&gt;Hi, here's what u can do :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Test = &lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;VAR R1=CALCULATE(count(Check[Reason 1]);Check[Reason 1]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR R2=CALCULATE(count(Check[Reason 2]);Check[Reason 2]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR R3=CALCULATE(count(Check[Reason 3]);Check[Reason 3]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR R4=CALCULATE(count(Check[Reason 4]);Check[Reason 4]="Incorrect")&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;"Reason1 = " &amp;amp; R1 &amp;amp; " ; Reason2 = " &amp;amp; R2 &amp;amp; " ; Reason3 = " &amp;amp; R3 &amp;amp; " ; Reason4 = " &amp;amp; R4&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 08:07:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813391#M5301</guid>
      <dc:creator>Rahal</dc:creator>
      <dc:date>2019-10-09T08:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813663#M5315</link>
      <description>&lt;P&gt;Is that considered a new table, column or measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally the ; that you have on lines 3-6 I cant not get to work. Should that be a comma?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 12:30:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813663#M5315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-09T12:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813673#M5316</link>
      <description>&lt;P&gt;That's a good idea. The only thing is I really have around 20 reasons and an ID can appear multiple times if it was incorrect for any reason the previous time it was submitted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this table would then grow exponentially and be extremely large if I am understanding it correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 12:41:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813673#M5316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-09T12:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813701#M5318</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thats a mesure, and yeah the ; on your case is a comma ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 13:19:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813701#M5318</guid>
      <dc:creator>Rahal</dc:creator>
      <dc:date>2019-10-09T13:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813713#M5319</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="44373" data-lia-user-login="Rahal" class="lia-mention lia-mention-user"&gt;Rahal&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is working now thank you for all your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing I am struggling with now is the Return statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get the return statement to use the reason as a column header and the R1 value as the value for that reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 13:36:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813713#M5319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-09T13:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813753#M5322</link>
      <description>&lt;P&gt;Hi, if i understand what you want to do, you will need to create 4 measure for each reason and name them what you want :&lt;/P&gt;&lt;P&gt;Ofc replace&lt;STRONG&gt; ;&lt;/STRONG&gt; with &lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Reason (1) = 
VAR R1=CALCULATE(count(Check[Reason 1]);Check[Reason 1]="Incorrect")
RETURN
if(ISBLANK(R1)=TRUE();0;R1)&lt;/PRE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 14:15:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813753#M5322</guid>
      <dc:creator>Rahal</dc:creator>
      <dc:date>2019-10-09T14:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813788#M5323</link>
      <description>&lt;P&gt;That is super helpful thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I go to make it into a clustered bar chart the axis is blank. How would I create a field to put in the axis so it labels all the bars as what the reason is?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 14:33:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813788#M5323</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-09T14:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813848#M5326</link>
      <description>&lt;P&gt;So, with the structure of your data you can only get something like this :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Otherwise you need to transform your data, for that u need to use SQL,&lt;/P&gt;&lt;P&gt;here i'm ganna start by creating my table Check :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Then i can tranform it also with Sql :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So finaly i can get what i need on Power BI :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:50:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813848#M5326</guid>
      <dc:creator>Rahal</dc:creator>
      <dc:date>2019-10-09T15:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Switch True</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813851#M5327</link>
      <description>&lt;P&gt;I appreciate all your help on this!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:55:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Switch-True/m-p/813851#M5327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-09T15:55:26Z</dc:date>
    </item>
  </channel>
</rss>

