<?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 Using SWITCH (TRUE(),) but  Grand Total calculation is missing in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-SWITCH-TRUE-but-Grand-Total-calculation-is-missing/m-p/2868357#M6114</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the Grand Total value but it is misisng.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;revenuediff = 
var currentweeknum = SELECTEDVALUE(table[weeknum cloumn])
var website = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[web_site]),table[weeknum cloumn]= currentweeknum -1))
var product = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[product]),table[weeknum cloumn]= currentweeknum -1))
var size = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[size]),table[weeknum cloumn] = currentweeknum -1))
var device = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[device_]),table[weeknum cloumn] = currentweeknum -1))
return
SWITCH(true(),ISINSCOPE(table[web_site]),website,ISINSCOPE(table[product]),product,ISINSCOPE(table[size]),size,ISINSCOPE(table[device_]),device)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[revenue] is a measure btw.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="halskwibskc_0-1666880886748.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/812084iEA6D8B4E94122529/image-size/medium?v=v2&amp;amp;px=400" role="button" title="halskwibskc_0-1666880886748.png" alt="halskwibskc_0-1666880886748.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to show the grand total correctly?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2022 14:28:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-27T14:28:31Z</dc:date>
    <item>
      <title>Using SWITCH (TRUE(),) but  Grand Total calculation is missing</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-SWITCH-TRUE-but-Grand-Total-calculation-is-missing/m-p/2868357#M6114</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the Grand Total value but it is misisng.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;revenuediff = 
var currentweeknum = SELECTEDVALUE(table[weeknum cloumn])
var website = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[web_site]),table[weeknum cloumn]= currentweeknum -1))
var product = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[product]),table[weeknum cloumn]= currentweeknum -1))
var size = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[size]),table[weeknum cloumn] = currentweeknum -1))
var device = [revenue] - CALCULATE([revenue],FILTER(ALLEXCEPT(table,table[device_]),table[weeknum cloumn] = currentweeknum -1))
return
SWITCH(true(),ISINSCOPE(table[web_site]),website,ISINSCOPE(table[product]),product,ISINSCOPE(table[size]),size,ISINSCOPE(table[device_]),device)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[revenue] is a measure btw.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="halskwibskc_0-1666880886748.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/812084iEA6D8B4E94122529/image-size/medium?v=v2&amp;amp;px=400" role="button" title="halskwibskc_0-1666880886748.png" alt="halskwibskc_0-1666880886748.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to show the grand total correctly?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 14:28:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-SWITCH-TRUE-but-Grand-Total-calculation-is-missing/m-p/2868357#M6114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-27T14:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using SWITCH (TRUE(),) but  Grand Total calculation is missing</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-SWITCH-TRUE-but-Grand-Total-calculation-is-missing/m-p/2893972#M6181</link>
      <description>&lt;P&gt;Grand Total and SELECTEDVALUE are incompatible. Change your formula to avoid the use of SELECTEDVALUE.&amp;nbsp; Use VALUES&amp;nbsp; instead, for example.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 01:49:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-SWITCH-TRUE-but-Grand-Total-calculation-is-missing/m-p/2893972#M6181</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-11-09T01:49:36Z</dc:date>
    </item>
  </channel>
</rss>

