<?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: DAX formula resulting in the currency code for which the value is highest in the fact table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261681#M120652</link>
    <description>&lt;P&gt;1 Net USD =&lt;/P&gt;&lt;P&gt;VAR maxusd = CALCULATE(MAX('&lt;SPAN&gt;fct_bookings'[Net USD]&lt;/SPAN&gt;),ALLEXCEPT('&lt;SPAN&gt;fct_bookings'[BT Customer No]&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;RETURN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;maxusd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 ) Currency =&lt;/P&gt;&lt;P&gt;VAR maxcurrency = CALCULATE(MAX('&lt;SPAN&gt;fct_bookings'[Trx Currency Code]&lt;/SPAN&gt;),[Net USD]))&lt;/P&gt;&lt;P&gt;RETURN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;maxcurrency&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2023 10:51:46 GMT</pubDate>
    <dc:creator>devanshi</dc:creator>
    <dc:date>2023-05-31T10:51:46Z</dc:date>
    <item>
      <title>DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261476#M120626</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the fact table "fct_bookings" that looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my dimension table "dim_distributor" I would like to create two calculated columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Net USD - which will result in the sum of all Net USD values from fact table for currency that has the highest share (based on Net USD value) for that particular customer&lt;/P&gt;&lt;P&gt;Currency - currency code with the highest share (based on Net USD value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result would look like this:&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;Can you help me with DAX for columns "Net USD" and "Currency"?&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:01:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261476#M120626</guid>
      <dc:creator>PshemekFLK</dc:creator>
      <dc:date>2023-05-31T10:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261545#M120631</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="78321" data-lia-user-login="PshemekFLK" class="lia-mention lia-mention-user"&gt;PshemekFLK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what do you mean by share?&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 09:57:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261545#M120631</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-05-31T09:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261573#M120633</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean if one customer ordered 399 in GBP and 300 in EUR then result should show 399 in GBP as it is higher than EUR, I just edited the second table with the correct desired result. Apologies for confusion.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:03:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261573#M120633</guid>
      <dc:creator>PshemekFLK</dc:creator>
      <dc:date>2023-05-31T10:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261584#M120634</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="78321" data-lia-user-login="PshemekFLK" class="lia-mention lia-mention-user"&gt;PshemekFLK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;are the two mentioned tables related?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:10:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261584#M120634</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-05-31T10:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261592#M120635</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;, yes - one to many relationship from dim_distributor to fct_bookings by the field BT Customer No&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:12:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261592#M120635</guid>
      <dc:creator>PshemekFLK</dc:creator>
      <dc:date>2023-05-31T10:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261637#M120644</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="78321" data-lia-user-login="PshemekFLK" class="lia-mention lia-mention-user"&gt;PshemekFLK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try to create two calculated columns like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Currency = 
MAXX(
    TOPN(
        1, 
        RELATEDTABLE(fct_bookings),
        CALCULATE(SUM(fct_bookings[NetUSD]))
    ),
    fct_bookings[Currency]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;NetUsD = 
SUMX(
    TOPN(
        1, 
        RELATEDTABLE(fct_bookings),
        CALCULATE(SUM(fct_bookings[NetUSD]))
    ),
    fct_bookings[NetUSD]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it worked like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:29:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261637#M120644</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-05-31T10:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261681#M120652</link>
      <description>&lt;P&gt;1 Net USD =&lt;/P&gt;&lt;P&gt;VAR maxusd = CALCULATE(MAX('&lt;SPAN&gt;fct_bookings'[Net USD]&lt;/SPAN&gt;),ALLEXCEPT('&lt;SPAN&gt;fct_bookings'[BT Customer No]&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;RETURN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;maxusd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 ) Currency =&lt;/P&gt;&lt;P&gt;VAR maxcurrency = CALCULATE(MAX('&lt;SPAN&gt;fct_bookings'[Trx Currency Code]&lt;/SPAN&gt;),[Net USD]))&lt;/P&gt;&lt;P&gt;RETURN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;maxcurrency&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:51:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261681#M120652</guid>
      <dc:creator>devanshi</dc:creator>
      <dc:date>2023-05-31T10:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula resulting in the currency code for which the value is highest in the fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261688#M120653</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;This works great! Many thanks! One additional question: what if I add a grouping of customers to my dimensions table like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What would the DAX look like for "Group Currency"?&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:55:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-resulting-in-the-currency-code-for-which-the-value/m-p/3261688#M120653</guid>
      <dc:creator>PshemekFLK</dc:creator>
      <dc:date>2023-05-31T10:55:10Z</dc:date>
    </item>
  </channel>
</rss>

