<?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: Create mesure when a field of one column is equal to a field of another column from another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219474#M117629</link>
    <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Promo same brands =
SUMX (
    'Fact table',
    IF (
        RELATED ( 'My brands'[Brand] ) = RELATED ( 'My competitors'[Brand] ),
        'Fact table'[Promo]
    )
)
&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 04 May 2023 08:21:03 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-05-04T08:21:03Z</dc:date>
    <item>
      <title>Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219442#M117627</link>
      <description>&lt;P&gt;Hello Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my model, I have 2 dimension tables and one fact table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first dimension table includes only my brands.&amp;nbsp;&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;Brand ID&lt;/TD&gt;&lt;TD&gt;BRand&lt;/TD&gt;&lt;TD&gt;Mode&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Audi&lt;/TD&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Audi&lt;/TD&gt;&lt;TD&gt;A3&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;The second dimension table includes my competitors brands and also my brands.&amp;nbsp;&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;Competitor ID&lt;/TD&gt;&lt;TD&gt;Competitor Brand&lt;/TD&gt;&lt;TD&gt;Competitor Model&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Skoda&lt;/TD&gt;&lt;TD&gt;Fabia&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Audi&lt;/TD&gt;&lt;TD&gt;A3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Peugeot&lt;/TD&gt;&lt;TD&gt;203&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;PEugeot&lt;/TD&gt;&lt;TD&gt;205&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;Audi&lt;/TD&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;PEugeot&lt;/TD&gt;&lt;TD&gt;2008&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data model looks like below:&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;I would like to create a Dax that would say: calculate the "Promo"&amp;nbsp; only when model in the "My Brand" dim table is equal to the model in the "My Competitor" dim table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What dax formula could I use?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 07:55:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219442#M117627</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-05-04T07:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219474#M117629</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Promo same brands =
SUMX (
    'Fact table',
    IF (
        RELATED ( 'My brands'[Brand] ) = RELATED ( 'My competitors'[Brand] ),
        'Fact table'[Promo]
    )
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 04 May 2023 08:21:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219474#M117629</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-05-04T08:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219641#M117646</link>
      <description>&lt;P&gt;HI&amp;nbsp;&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;,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I have tried to adapt your Dax to my need :&amp;nbsp; In my fact, there is also a column to identify the type of promo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For exemple, I want to calculate the Promo for the "Rebate" type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following but obviously is inccorrect:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMX (
    'Fact table',
    IF (
        RELATED ( 'My brands'[Brand] ) = RELATED ( 'My competitors'[Brand] ), Filter( lookup_promotype[Promo Type] = "Rebate"),
        'Fact table'[Promo]
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or is it possible to use the Related function with Calculte?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 09:49:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219641#M117646</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-05-04T09:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219644#M117647</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUMX (
    'Fact table',
    IF (
        RELATED ( 'My brands'[Brand] ) = RELATED ( 'My competitors'[Brand] ) &amp;amp;&amp;amp; RELATED( lookup_promotype[Promo Type]) = "Rebate",
        'Fact table'[Promo]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:14:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219644#M117647</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-05-04T10:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219660#M117649</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;I get an error message :&amp;nbsp;&lt;EM&gt;Function RELATED expects a fully qualified column reference as its argument.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;the part&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RELATED( lookup_promotype[Promo Type] = "Rebate"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;seems to be the issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:06:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219660#M117649</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-05-04T10:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219676#M117652</link>
      <description>&lt;P&gt;My fault, I had a ) in the wrong place. I've edited my post to correct it.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:14:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219676#M117652</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-05-04T10:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219697#M117656</link>
      <description>&lt;P&gt;many thanks&amp;nbsp;&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;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:22:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219697#M117656</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-05-04T10:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219710#M117659</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;Question by curiosity: in this case, what would be more efficient, using Calulate(sum()) or using Sumx like you did?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:26:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219710#M117659</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-05-04T10:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create mesure when a field of one column is equal to a field of another column from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219723#M117661</link>
      <description>&lt;P&gt;I don't think you could do it without SUMX, as you need to get a row context to compare the values from my brands and competitors.&lt;/P&gt;
&lt;P&gt;You could wrap that SUMX in a CALCULATE to perform the filtering on promo type, not sure which would be more efficient, you'd need to do tests using DAX Studio, but unless it was a very large dataset I would think the difference would be negligible.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:32:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-mesure-when-a-field-of-one-column-is-equal-to-a-field-of/m-p/3219723#M117661</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-05-04T10:32:42Z</dc:date>
    </item>
  </channel>
</rss>

