<?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: Sales measure to show products in a matrix based on slicer selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1935863#M42089</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267852" data-lia-user-login="Payeras_BI" class="lia-mention lia-mention-user"&gt;Payeras_BI&lt;/a&gt;&amp;nbsp;thanks for posting. I'm sorry I simplified my mock data, so It worked for this particular case because there was no overlapping in products with 0 sales. In real data, sales can be 0 for the products witch are associated with a campaign and obviously, 0 for the products with are not associated with this campaign. So the rows are not unique anymore and when I throw in your simple measure it will show all products for each campaign. I reuploaded my sample pbix so it's closer to real data. That's why I had to manually match products with campaigns in my measure. Could anyone help to fix my issue?&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 20:38:56 GMT</pubDate>
    <dc:creator>powerbiuser444</dc:creator>
    <dc:date>2021-07-02T20:38:56Z</dc:date>
    <item>
      <title>Sales measure to show products in a matrix based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1933827#M42036</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data: 4 campaigns with a set of products.&lt;/P&gt;&lt;P&gt;Campaign1 - Product1, Product2&lt;/P&gt;&lt;P&gt;Campaign2 - Product1, Product2&lt;/P&gt;&lt;P&gt;Campaign3 - Product3, Product4&lt;/P&gt;&lt;P&gt;Campaign4 - Product5, Product6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I built a data model and created a measure that shows corresponding products based on campaign selection in a slicer. It works fine for individual campaigns and sums up sales for campaigns with the same products (in my case Campaign1 and Campaign2). But I can't figure out how to get my measure to show all products for campaigns with different product types and sums them up.&lt;BR /&gt;For example, when I pick Campaign1 and Campaign3 in the slicer I want to see Total Sales, Product1, Product2, Product3, Product4 in the matrix. And same logic should be applied to other campaigns with different product types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please see the attached &lt;A title="pbix" href="https://7xinc-my.sharepoint.com/:u:/g/personal/powerbi_admin_7xpowered_com/ESn3eME85IFAqVB9XB3vglABcBizqONVQIur0erDW5eAYw?e=cErf9U" target="_self"&gt;pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like it should be an easy fix. Please help!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 20:31:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1933827#M42036</guid>
      <dc:creator>powerbiuser444</dc:creator>
      <dc:date>2021-07-02T20:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sales measure to show products in a matrix based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1934987#M42067</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="265346" data-lia-user-login="powerbiuser444" class="lia-mention lia-mention-user"&gt;powerbiuser444&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If I understood correctly this could be done with a simple SUM(Data[Value]) as a measure.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;</description>
      <pubDate>Fri, 02 Jul 2021 09:30:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1934987#M42067</guid>
      <dc:creator>Payeras_BI</dc:creator>
      <dc:date>2021-07-02T09:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sales measure to show products in a matrix based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1935863#M42089</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267852" data-lia-user-login="Payeras_BI" class="lia-mention lia-mention-user"&gt;Payeras_BI&lt;/a&gt;&amp;nbsp;thanks for posting. I'm sorry I simplified my mock data, so It worked for this particular case because there was no overlapping in products with 0 sales. In real data, sales can be 0 for the products witch are associated with a campaign and obviously, 0 for the products with are not associated with this campaign. So the rows are not unique anymore and when I throw in your simple measure it will show all products for each campaign. I reuploaded my sample pbix so it's closer to real data. That's why I had to manually match products with campaigns in my measure. Could anyone help to fix my issue?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 20:38:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1935863#M42089</guid>
      <dc:creator>powerbiuser444</dc:creator>
      <dc:date>2021-07-02T20:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sales measure to show products in a matrix based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1936161#M42108</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="265346" data-lia-user-login="powerbiuser444" class="lia-mention lia-mention-user"&gt;powerbiuser444&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;In this case would you consider any of the following as possible solutions?&lt;/P&gt;
&lt;P&gt;A) Filtering the visual while still using SUM(Data[Value])?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B)&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 3 = 
CALCULATE(
    SUM(Data[Value]),
    Data[Value]&amp;lt;&amp;gt;0
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 13:48:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1936161#M42108</guid>
      <dc:creator>Payeras_BI</dc:creator>
      <dc:date>2021-07-03T13:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sales measure to show products in a matrix based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1939010#M42187</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="267852" data-lia-user-login="Payeras_BI" class="lia-mention lia-mention-user"&gt;Payeras_BI&lt;/a&gt;&amp;nbsp;thanks for your options, but it's still not quite what I'm looking for. I still want to see a column with 0 sales if it is associated with the campaign and I want 'Total' to be the first column. If you check my measure I already got this, just can't figure out to get it working for multiple selections&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 04:13:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1939010#M42187</guid>
      <dc:creator>powerbiuser444</dc:creator>
      <dc:date>2021-07-06T04:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sales measure to show products in a matrix based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1939828#M42203</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="265346" data-lia-user-login="powerbiuser444" class="lia-mention lia-mention-user"&gt;powerbiuser444&lt;/a&gt;,&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 3 = 
VAR SelectedAttribute =
    SELECTEDVALUE ( Attributes[Attribute] )
VAR SelectedCampaign =
    VALUES ( Campaigns[Campaign] )
RETURN
    IF (
        SelectedAttribute = "Total Sales",
        CALCULATE ( SUM ( Data[Value] ), REMOVEFILTERS ( Attributes ) ),
              IF (
                OR("Campaign1" IN SelectedCampaign,"Campaign2" IN SelectedCampaign),
                CALCULATE ( SUM ( Data[Value] ), Data[Attribute] IN { "Product1", "Product2" } )
              )
            + IF (
                "Campaign3" IN SelectedCampaign,
                CALCULATE ( SUM ( Data[Value] ), Data[Attribute] IN { "Product3", "Product4" } )
              )
            + IF (
                "Campaign4" IN SelectedCampaign,
                CALCULATE ( SUM ( Data[Value] ), Data[Attribute] IN { "Product5", "Product6" } )
              )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://ideas.powerbi.com/ideas/idea/?ideaid=d49034ec-dd04-420b-b86b-727fbbeaf53b" target="_self"&gt;Vote for this Idea &amp;gt; Table / Matrix: Total Column on first position&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 10:16:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-measure-to-show-products-in-a-matrix-based-on-slicer/m-p/1939828#M42203</guid>
      <dc:creator>Payeras_BI</dc:creator>
      <dc:date>2021-07-06T10:16:47Z</dc:date>
    </item>
  </channel>
</rss>

