<?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: Comparaison between old category and new category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparaison-between-old-category-and-new-category/m-p/3050487#M105053</link>
    <description>&lt;P&gt;Create a category dimension table like&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Category =
DISTINCT (
    UNION (
        SELECTCOLUMNS ( DISTINCT ( 'Table'[Old] ), "Category", 'Table'[Old] ),
        SELECTCOLUMNS ( DISTINCT ( 'Table'[New] ), "Category", 'Table'[New] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;and then link this table to the data table for both Old and New columns. Only 1 relationship can be active but thats OK.&lt;/P&gt;
&lt;P&gt;You can then create a measure like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Diff old and new =
VAR OldValue =
    CALCULATE (
        SUM ( 'Table'[Spend] ),
        USERELATIONSHIP ( 'Table'[Old], 'Category'[Category] )
    )
VAR NewValue =
    CALCULATE (
        SUM ( 'Table'[Spend] ),
        USERELATIONSHIP ( 'Table'[New], 'Category'[Category] )
    )
RETURN
    NewValue - OldValue
&lt;/LI-CODE&gt;
&lt;P&gt;and put this in a visual with the category column from the dimension table&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 13:39:59 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-01-30T13:39:59Z</dc:date>
    <item>
      <title>Comparaison between old category and new category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparaison-between-old-category-and-new-category/m-p/3050429#M105046</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a table with the actual category and another column with new category and I would like to calculate the spend difference between the old and the new category.&lt;/P&gt;&lt;P&gt;Let me explain you with an example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I would like to have the spend in € for each categories for old and new, like that I can compare if we have less or more spend for each category by [New Spend]- [Old Spend].&lt;BR /&gt;&lt;BR /&gt;Thanks for your support !&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 13:08:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparaison-between-old-category-and-new-category/m-p/3050429#M105046</guid>
      <dc:creator>AxelKAp</dc:creator>
      <dc:date>2023-01-30T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between old category and new category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparaison-between-old-category-and-new-category/m-p/3050487#M105053</link>
      <description>&lt;P&gt;Create a category dimension table like&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Category =
DISTINCT (
    UNION (
        SELECTCOLUMNS ( DISTINCT ( 'Table'[Old] ), "Category", 'Table'[Old] ),
        SELECTCOLUMNS ( DISTINCT ( 'Table'[New] ), "Category", 'Table'[New] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;and then link this table to the data table for both Old and New columns. Only 1 relationship can be active but thats OK.&lt;/P&gt;
&lt;P&gt;You can then create a measure like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Diff old and new =
VAR OldValue =
    CALCULATE (
        SUM ( 'Table'[Spend] ),
        USERELATIONSHIP ( 'Table'[Old], 'Category'[Category] )
    )
VAR NewValue =
    CALCULATE (
        SUM ( 'Table'[Spend] ),
        USERELATIONSHIP ( 'Table'[New], 'Category'[Category] )
    )
RETURN
    NewValue - OldValue
&lt;/LI-CODE&gt;
&lt;P&gt;and put this in a visual with the category column from the dimension table&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 13:39:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparaison-between-old-category-and-new-category/m-p/3050487#M105053</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-01-30T13:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between old category and new category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparaison-between-old-category-and-new-category/m-p/3050572#M105058</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp;It works ! Thank a lot for your support &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 14:14:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparaison-between-old-category-and-new-category/m-p/3050572#M105058</guid>
      <dc:creator>AxelKAp</dc:creator>
      <dc:date>2023-01-30T14:14:44Z</dc:date>
    </item>
  </channel>
</rss>

