<?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: Sum by multiple Categories in a Measure in a visual with no said Category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3711600#M144409</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;I assume the semantic model looks like the below, and please check the below picture and the attached pbix file.&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/treatas-function?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;TREATAS function - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Expected result measure: =
VAR _t =
    SUMMARIZE ( Data, City[City Name], 'Product'[Product] )
VAR _filterfact =
    CALCULATETABLE (
        ALLSELECTED ( Data ),
        TREATAS ( _t, Data[City Name], Data[Product] )
    )
RETURN
    IF ( HASONEVALUE ( Shop[Shop Name] ), SUMX ( _filterfact, Data[QTY] ) )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2024 15:51:06 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2024-02-20T15:51:06Z</dc:date>
    <item>
      <title>Sum by multiple Categories in a Measure in a visual with no said Category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3711520#M144408</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im looking for a meausure very similar to this&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Sum-by-Category-Measure-in-a-visual-with-no-Category/td-p/2641794" target="_blank" rel="noopener"&gt;https://community.fabric.microsoft.com/t5/Desktop/Sum-by-Category-Measure-in-a-visual-with-no-Category/td-p/2641794&lt;/A&gt;&amp;nbsp;but with multiple categories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 4 columns, Shop Name, City, product and quantity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Shop Name&lt;/TD&gt;&lt;TD&gt;City Name&lt;/TD&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;QTY&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fruit Galore&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Antwerp&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;carrots&lt;/TD&gt;&lt;TD&gt;137&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fruit Fest&lt;/TD&gt;&lt;TD&gt;London&lt;/TD&gt;&lt;TD&gt;carrots&lt;/TD&gt;&lt;TD&gt;245&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fruit Fest&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Antwerp&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;carrots&lt;/TD&gt;&lt;TD&gt;453&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fruit Fest&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Antwerp&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to show the total quantity in the network for every city/product combo related to the shop but &lt;STRONG&gt;not&lt;/STRONG&gt; showing the city and product in visual. The resulting table would look like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Shop Name&lt;/TD&gt;&lt;TD&gt;Qty&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fruit Galore&lt;/TD&gt;&lt;TD&gt;590&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fruit Fest&lt;/TD&gt;&lt;TD&gt;855&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fruit Galore is 590 because total&amp;nbsp; Antwerp/Carrot-453+137&lt;/P&gt;&lt;P&gt;Fruit Fest is the sum of everything since it was every combination.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a dax measure that can do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 15:30:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3711520#M144408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-20T15:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum by multiple Categories in a Measure in a visual with no said Category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3711600#M144409</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;I assume the semantic model looks like the below, and please check the below picture and the attached pbix file.&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/treatas-function?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;TREATAS function - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Expected result measure: =
VAR _t =
    SUMMARIZE ( Data, City[City Name], 'Product'[Product] )
VAR _filterfact =
    CALCULATETABLE (
        ALLSELECTED ( Data ),
        TREATAS ( _t, Data[City Name], Data[Product] )
    )
RETURN
    IF ( HASONEVALUE ( Shop[Shop Name] ), SUMX ( _filterfact, Data[QTY] ) )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 15:51:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3711600#M144409</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-02-20T15:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sum by multiple Categories in a Measure in a visual with no said Category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3711955#M144427</link>
      <description>&lt;P&gt;Thank you, the output is what im looking for but im using a different data set with a similar semantic model. I have never really used the virtual table before, can you explain the logic and purpose of using the variables _t&amp;nbsp; and _filterfact? I want to recreate the measure with tables I'm using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_t is creating every city product combinantion in a table correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_filterfact is recreating the 'data' table virtually to be used in the calculate function?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 18:12:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3711955#M144427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-20T18:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sum by multiple Categories in a Measure in a visual with no said Category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3712950#M144475</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you for your message, and you are correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check the comments down below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Expected result measure: =
VAR _t =       //  it shows all the combination of city and product of each row (shop name).
    SUMMARIZE ( Data, City[City Name], 'Product'[Product] )

VAR _filterfact =          // from all fact table ( remove filter context), apply the combination of city and product that are generated from above.
    CALCULATETABLE (
        ALLSELECTED ( Data ),
        TREATAS ( _t, Data[City Name], Data[Product] )
    )

RETURN
    IF ( HASONEVALUE ( Shop[Shop Name] ), SUMX ( _filterfact, Data[QTY] ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Feb 2024 04:05:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3712950#M144475</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-02-21T04:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum by multiple Categories in a Measure in a visual with no said Category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3728372#M145260</link>
      <description>&lt;P&gt;follow-up question as some of my requirements have changed. How would I do this as a calculated column?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 17:39:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-by-multiple-Categories-in-a-Measure-in-a-visual-with-no-said/m-p/3728372#M145260</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-27T17:39:36Z</dc:date>
    </item>
  </channel>
</rss>

