<?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 calculated column using different FX rates based on type and date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/3996282#M155270</link>
    <description>&lt;P&gt;Here is my desired output, but where the "reporting date" columns on the fact table are actually 1 dynamic calculated column based on which reporting date I am looking at (Probably to be used with a slicer if possible!)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 14:01:55 GMT</pubDate>
    <dc:creator>Mattm1989</dc:creator>
    <dc:date>2024-06-17T14:01:55Z</dc:date>
    <item>
      <title>DAX calculated column using different FX rates based on type and date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/3996238#M155269</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling for a DAX function/formula with or without use of variables that allows me to select different FX rates based on 1 criteria (Balance Sheet or P&amp;amp;L) ((this is the easy bit which I can do)), but then be able to have a dynamic table for the Balance Sheet rate to change dependant on the reporting date selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example is below:&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;So basically I'd like another column on the fact table with the rate to be used where:&lt;BR /&gt;If P&amp;amp;L, then it would be the corresponding month currency and Average rate regardless of reporting month...&lt;BR /&gt;AND then&lt;BR /&gt;If BS, the rate would correspond with the currency and use the spot rate, but be dynamic and change based on the reporting date selected, overriding the date in the pFACT table.&lt;BR /&gt;I would then need to be able to show the full data set simultaneously, by month, using the reporting month as my columns in a visual.&lt;BR /&gt;&lt;BR /&gt;I'll create some screenshots of my desired output and post them here later today.&lt;BR /&gt;&lt;BR /&gt;If anybody can help, I'd really appreciate it!&lt;BR /&gt;&lt;BR /&gt;(Im only just starting to delve into calculated tables/columns and use variables and parameters so apologies if there is a fairly easy solution for this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 13:42:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/3996238#M155269</guid>
      <dc:creator>Mattm1989</dc:creator>
      <dc:date>2024-06-17T13:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX calculated column using different FX rates based on type and date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/3996282#M155270</link>
      <description>&lt;P&gt;Here is my desired output, but where the "reporting date" columns on the fact table are actually 1 dynamic calculated column based on which reporting date I am looking at (Probably to be used with a slicer if possible!)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:01:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/3996282#M155270</guid>
      <dc:creator>Mattm1989</dc:creator>
      <dc:date>2024-06-17T14:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX calculated column using different FX rates based on type and date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/3997698#M155469</link>
      <description>&lt;P&gt;Hi,&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="761265" data-lia-user-login="Mattm1989" class="lia-mention lia-mention-user"&gt;Mattm1989&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I am glad to help you.&lt;BR /&gt;&amp;nbsp;I tested it based on the data you provided. You can refer to it&lt;BR /&gt;Here is the DAX code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Feb = 
VAR _table = SUMMARIZE(ALL('Currency_Rates'),'Currency_Rates'[AVE Rate P&amp;amp;L],'Currency_Rates'[Currency],'Currency_Rates'[Date],Currency_Rates[Spot Rate BS])
VAR _Currency= 'pFACT'[Currency]
VAR _table2 = FILTER(_table,'Currency_Rates'[Currency] = _Currency)
VAR _PL = 'pFACT'[P&amp;amp;L/BS]
VAR _month = MONTH('pFACT'[EOMonth])
VAR _table3 = ADDCOLUMNS(_table2,"month",MONTH('Currency_Rates'[Date]))
VAR _table4 = FILTER(_table3,[month] =2)
RETURN SWITCH(TRUE(),
    _PL="P&amp;amp;L",AVERAGEX(_table2,'Currency_Rates'[AVE Rate P&amp;amp;L]),
    _PL= "BS",SUMX(_table4,'Currency_Rates'[Spot Rate BS])
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Jan = 
VAR _table = SUMMARIZE(ALL('Currency_Rates'),'Currency_Rates'[AVE Rate P&amp;amp;L],'Currency_Rates'[Currency],'Currency_Rates'[Date],Currency_Rates[Spot Rate BS])
VAR _Currency= 'pFACT'[Currency]
VAR _table2 = FILTER(_table,'Currency_Rates'[Currency] = _Currency)
VAR _PL = 'pFACT'[P&amp;amp;L/BS]
VAR _month = MONTH('pFACT'[EOMonth])
VAR _table3 = ADDCOLUMNS(_table2,"month",MONTH('Currency_Rates'[Date]))
VAR _table4 = FILTER(_table3,[month] =1)
RETURN SWITCH(TRUE(),
    _PL="P&amp;amp;L",AVERAGEX(_table2,'Currency_Rates'[AVE Rate P&amp;amp;L]),
    _PL= "BS",SUMX(_table4,'Currency_Rates'[Spot Rate BS])
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Mar = 
VAR _table = SUMMARIZE(ALL('Currency_Rates'),'Currency_Rates'[AVE Rate P&amp;amp;L],'Currency_Rates'[Currency],'Currency_Rates'[Date],Currency_Rates[Spot Rate BS])
VAR _Currency= 'pFACT'[Currency]
VAR _table2 = FILTER(_table,'Currency_Rates'[Currency] = _Currency)
VAR _PL = 'pFACT'[P&amp;amp;L/BS]
VAR _month = MONTH('pFACT'[EOMonth])
VAR _table3 = ADDCOLUMNS(_table2,"month",MONTH('Currency_Rates'[Date]))
VAR _table4 = FILTER(_table3,[month] =3)
RETURN SWITCH(TRUE(),
    _PL="P&amp;amp;L",AVERAGEX(_table2,'Currency_Rates'[AVE Rate P&amp;amp;L]),
    _PL= "BS",SUMX(_table4,'Currency_Rates'[Spot Rate BS])
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Carson Jian,&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 07:38:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/3997698#M155469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-18T07:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: DAX calculated column using different FX rates based on type and date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/4022380#M158709</link>
      <description>&lt;P&gt;Hi Carson&lt;BR /&gt;&lt;BR /&gt;Apologies for my delayed response, I have been on Holiday!.&lt;BR /&gt;The above solution is very close to what my required output is to be. However after re-reading my initial post, I don't think I explained the requirement very well.&lt;BR /&gt;Below is looking at a single currency. Any of the P&amp;amp;L rates should return the rate that was set for that specific month. The Blance sheet rate should return the latest month rate in that YTD period, but apply it to all previous Balance Sheet transactions in previous months that make up that YTD accumulation.&lt;BR /&gt;&lt;BR /&gt;Hopefully the below helps clarify?&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;I would be greatful if you could revisit this and help me get the desired output?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 08:35:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-calculated-column-using-different-FX-rates-based-on-type-and/m-p/4022380#M158709</guid>
      <dc:creator>Mattm1989</dc:creator>
      <dc:date>2024-07-03T08:35:41Z</dc:date>
    </item>
  </channel>
</rss>

