<?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 calculate market share by year on a line chart in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-market-share-by-year-on-a-line-chart/m-p/3421193#M129518</link>
    <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having some issue to plot a graph of market share per year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to represent the following graph:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the bar, it is a simple count formula. And the line shart should be the market share.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it seems like my formula is not working because when no filters are applied, the line should be at 100 percent for each year and not like on the graph above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my dax for the makert share:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Market Share = &lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;VAR totalIv&amp;nbsp;= CALCULATE(COUNT('Main Table original'[TVA]))&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;VAR totalMarket&amp;nbsp;= CALCULATE(COUNT('Main Table original'[TVA]), ALLEXCEPT('Main Table original', 'Main Table original'[Year]))&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Return DIVIDE(totalIv, totalMarket,0)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How can I fix my formula to have the line at 100 percent when no filters are applied?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 08 Sep 2023 09:02:16 GMT</pubDate>
    <dc:creator>Chrisjr</dc:creator>
    <dc:date>2023-09-08T09:02:16Z</dc:date>
    <item>
      <title>calculate market share by year on a line chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-market-share-by-year-on-a-line-chart/m-p/3421193#M129518</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having some issue to plot a graph of market share per year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to represent the following graph:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the bar, it is a simple count formula. And the line shart should be the market share.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it seems like my formula is not working because when no filters are applied, the line should be at 100 percent for each year and not like on the graph above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my dax for the makert share:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Market Share = &lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;VAR totalIv&amp;nbsp;= CALCULATE(COUNT('Main Table original'[TVA]))&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;VAR totalMarket&amp;nbsp;= CALCULATE(COUNT('Main Table original'[TVA]), ALLEXCEPT('Main Table original', 'Main Table original'[Year]))&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Return DIVIDE(totalIv, totalMarket,0)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How can I fix my formula to have the line at 100 percent when no filters are applied?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Sep 2023 09:02:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-market-share-by-year-on-a-line-chart/m-p/3421193#M129518</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-09-08T09:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: calculate market share by year on a line chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-market-share-by-year-on-a-line-chart/m-p/3421488#M129532</link>
      <description>&lt;P&gt;I found out the issue came from the filters in the filter pane on the right for this visual. The problem is solved&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 12:01:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-market-share-by-year-on-a-line-chart/m-p/3421488#M129532</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-09-08T12:01:49Z</dc:date>
    </item>
  </channel>
</rss>

