<?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 Calculation groups - timeintelligence and FX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-groups-timeintelligence-and-FX/m-p/4018885#M158518</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to creata a model to calculate 2 things:&lt;/P&gt;&lt;P&gt;- Timeintelligence functions&lt;/P&gt;&lt;P&gt;- Currency translations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used to do this through switches, where I have 2 FX types (source &amp;amp; actual) and 2 timeintelligence periods (Current and Prior year).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The switch I did by adding the time filtering through relationship of the connected DimDate.&lt;/P&gt;&lt;P&gt;And the FX I did by creating a calculated column Actual, which is just Value * Related FX rate in the connection DimCurrency table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in 2 value columns, the source (which is the Value column) and the actual (which is the FX translated value).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I go from Value -&amp;gt; Currency selector Switch -&amp;gt; Time selector Switch -&amp;gt; Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I rewrote this partially as calculation groups.&lt;/P&gt;&lt;P&gt;I removed the Time selector switch and added the calculation items in SelectTime:&lt;/P&gt;&lt;PRE&gt;&lt;FONT&gt; &lt;FONT&gt;CALCULATE&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; [Sum value], &lt;/FONT&gt;&lt;FONT&gt;DATESBETWEEN&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; DimDate[idDate], &lt;/FONT&gt;&lt;FONT&gt;FIRSTDATE&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; DimPeriod[cdmPeriodBeg] &lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt;LASTDATE&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; DimPeriod[cdmPeriodEnd] &lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt; &lt;FONT&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I use a disconnected periods table to prefilter the dimdate, due to the overlapping time periods, requiring me to reuse some idDates in other tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This calculation works, by changing indeed the result to the correct time period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my questions is, can I also add the FX calculation as a calculation group?&lt;/P&gt;&lt;P&gt;I need to be able to switch between both, i.e. Actual Prior year, or Source Current year, etc.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 15:46:33 GMT</pubDate>
    <dc:creator>bgc200</dc:creator>
    <dc:date>2024-07-01T15:46:33Z</dc:date>
    <item>
      <title>Calculation groups - timeintelligence and FX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-groups-timeintelligence-and-FX/m-p/4018885#M158518</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to creata a model to calculate 2 things:&lt;/P&gt;&lt;P&gt;- Timeintelligence functions&lt;/P&gt;&lt;P&gt;- Currency translations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used to do this through switches, where I have 2 FX types (source &amp;amp; actual) and 2 timeintelligence periods (Current and Prior year).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The switch I did by adding the time filtering through relationship of the connected DimDate.&lt;/P&gt;&lt;P&gt;And the FX I did by creating a calculated column Actual, which is just Value * Related FX rate in the connection DimCurrency table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in 2 value columns, the source (which is the Value column) and the actual (which is the FX translated value).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I go from Value -&amp;gt; Currency selector Switch -&amp;gt; Time selector Switch -&amp;gt; Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I rewrote this partially as calculation groups.&lt;/P&gt;&lt;P&gt;I removed the Time selector switch and added the calculation items in SelectTime:&lt;/P&gt;&lt;PRE&gt;&lt;FONT&gt; &lt;FONT&gt;CALCULATE&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; [Sum value], &lt;/FONT&gt;&lt;FONT&gt;DATESBETWEEN&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; DimDate[idDate], &lt;/FONT&gt;&lt;FONT&gt;FIRSTDATE&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; DimPeriod[cdmPeriodBeg] &lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt;LASTDATE&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; DimPeriod[cdmPeriodEnd] &lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt; &lt;FONT&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I use a disconnected periods table to prefilter the dimdate, due to the overlapping time periods, requiring me to reuse some idDates in other tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This calculation works, by changing indeed the result to the correct time period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my questions is, can I also add the FX calculation as a calculation group?&lt;/P&gt;&lt;P&gt;I need to be able to switch between both, i.e. Actual Prior year, or Source Current year, etc.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 15:46:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-groups-timeintelligence-and-FX/m-p/4018885#M158518</guid>
      <dc:creator>bgc200</dc:creator>
      <dc:date>2024-07-01T15:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation groups - timeintelligence and FX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-groups-timeintelligence-and-FX/m-p/4019497#M158565</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="768807" data-lia-user-login="bgc200" class="lia-mention lia-mention-user"&gt;bgc200&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, it is possible to create a new calculation group for fx calculations. Then, define calculation items for fx types.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can view the following documents to learn more information.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups?view=asallproducts-allversions#currency-conversion-example" target="_blank"&gt;Calculation groups in Analysis Services tabular models | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/transform-model/calculation-groups#time-intelligence-example" target="_blank"&gt;Create calculation groups in Power BI (preview) - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 02:37:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-groups-timeintelligence-and-FX/m-p/4019497#M158565</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-02T02:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation groups - timeintelligence and FX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-groups-timeintelligence-and-FX/m-p/4020534#M158613</link>
      <description>&lt;P&gt;thanks for the reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this mean I can indeed have 2 different groups, 1 for the FX calculation and 1 for the time intelligence filtering?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does my current solution with the FX translation as different calculated columns and then a separate sum measure for both work in this context?&lt;/P&gt;&lt;P&gt;Or do I need to do the FX calculation in the calculation group?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly, what's the correct precedence order?&amp;nbsp;&lt;/P&gt;&lt;P&gt;First the time intelligence to filter my values table and then apply the FX translation calculation through a SUMX of Value * Related FXrate?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 13:11:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-groups-timeintelligence-and-FX/m-p/4020534#M158613</guid>
      <dc:creator>bgc200</dc:creator>
      <dc:date>2024-07-02T13:11:11Z</dc:date>
    </item>
  </channel>
</rss>

