<?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 From Sum To Count with Radio Button in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Switch-From-Sum-To-Count-with-Radio-Button/m-p/4385747#M59231</link>
    <description>&lt;P&gt;Is there a way to switch from sum to count of a value in powerbi? and not on a chart level while creating the visual? but have a drop down that lets you select whether to sum up the values along a column or to count them&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2025 08:34:56 GMT</pubDate>
    <dc:creator>WilliamMunguti</dc:creator>
    <dc:date>2025-01-29T08:34:56Z</dc:date>
    <item>
      <title>Switch From Sum To Count with Radio Button</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Switch-From-Sum-To-Count-with-Radio-Button/m-p/4385747#M59231</link>
      <description>&lt;P&gt;Is there a way to switch from sum to count of a value in powerbi? and not on a chart level while creating the visual? but have a drop down that lets you select whether to sum up the values along a column or to count them&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 08:34:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Switch-From-Sum-To-Count-with-Radio-Button/m-p/4385747#M59231</guid>
      <dc:creator>WilliamMunguti</dc:creator>
      <dc:date>2025-01-29T08:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Switch From Sum To Count with Radio Button</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Switch-From-Sum-To-Count-with-Radio-Button/m-p/4387166#M59249</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/840077"&gt;@WilliamMunguti&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;You can do this using bookmarks or DAX, but you mentioned "not on a chart level while creating the visual", so you can only do it via DAX.&lt;BR /&gt;&lt;BR /&gt;Here is my sample data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vjunyantmsft_0-1738199515811.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1232462i98E5FF2D1AC281FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vjunyantmsft_0-1738199515811.png" alt="vjunyantmsft_0-1738199515811.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Create another table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vjunyantmsft_1-1738199535270.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1232463i6FFEEF9D6A127787/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vjunyantmsft_1-1738199535270.png" alt="vjunyantmsft_1-1738199535270.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And use this table to create a slicer:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vjunyantmsft_2-1738199713434.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1232464iD08630191AE373C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vjunyantmsft_2-1738199713434.png" alt="vjunyantmsft_2-1738199713434.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Use these DAXs to create measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum = SUM('Table'[Value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Count = COUNT('Table'[Value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Output = 
SWITCH(
    SELECTEDVALUE(Slicer[Button]),
    "COUNT", [Count],
    "SUM", [Sum],
    [Sum]
)&lt;/LI-CODE&gt;
&lt;P&gt;And the final output is as below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vjunyantmsft_3-1738199736748.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1232465iCD75012DCDE6B3BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vjunyantmsft_3-1738199736748.png" alt="vjunyantmsft_3-1738199736748.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vjunyantmsft_4-1738199742926.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1232466i45D53E811E03997E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vjunyantmsft_4-1738199742926.png" alt="vjunyantmsft_4-1738199742926.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dino Tao&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 01:18:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Switch-From-Sum-To-Count-with-Radio-Button/m-p/4387166#M59249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-30T01:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Switch From Sum To Count with Radio Button</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Switch-From-Sum-To-Count-with-Radio-Button/m-p/4389819#M59289</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks for this. Let me try it out and will give you feedback&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 11:56:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Switch-From-Sum-To-Count-with-Radio-Button/m-p/4389819#M59289</guid>
      <dc:creator>WilliamMunguti</dc:creator>
      <dc:date>2025-01-31T11:56:28Z</dc:date>
    </item>
  </channel>
</rss>

