<?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: Proper Calculation of Facts/Values from Dimensional Table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3159120#M113395</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;I came up with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
    VAR __idYearProduct = DISTINCT('factSales'[*idYearProduct])
    VAR __Result = SUMX(FILTER(ALL('dimSalesYearly'), [idYearProduct] IN __idYearProduct), [YearVolume])
RETURN
    __Result&lt;/LI-CODE&gt;&lt;P&gt;Or, you know, make the relationship bi-directional would work as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 18:01:32 GMT</pubDate>
    <dc:creator>NotGregDeckler</dc:creator>
    <dc:date>2023-03-28T18:01:32Z</dc:date>
    <item>
      <title>Proper Calculation of Facts/Values from Dimensional Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3152713#M112986</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Source&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;(&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/DenisSipchenko/Power-BI/blob/341a4a3927fe65550edbe9a81eefaa8a6d30620e/Questions/DAX%20ProperCalc_ofFactsInDimTable.pbix" target="_self" rel="nofollow noopener noreferrer"&gt;Download Here&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Userstory:&lt;BR /&gt;Imagine you have big star shema model and important values/facts in dimensional Tables.&lt;BR /&gt;And you don't want to mess up your fact table with multiple low cardinality columns.&lt;BR /&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; How to proper handle these dimTable facts/values?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Simplified Example&lt;/STRONG&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;Question: How to get &lt;STRONG&gt;DESIRED YearVolume&lt;/STRONG&gt; (because by default it gives 2200 (Totals) in each cell)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 11:55:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3152713#M112986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-29T11:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Calculation of Facts/Values from Dimensional Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3152717#M112987</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Solution &lt;/STRONG&gt;(&amp;nbsp;&lt;A href="https://github.com/DenisSipchenko/Power-BI/blob/341a4a3927fe65550edbe9a81eefaa8a6d30620e/Questions/DAX%20ProperCalc_ofFactsInDimTable.pbix" target="_self"&gt;Download Here&lt;/A&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DESIRED YearVolume = 
CALCULATE(
    SUM(dimSalesYearly[YearVolume]),
    KEEPFILTERS(factSales)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It could be used as simple pattern for similar cases&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Advanced Example Solution&lt;/STRONG&gt;:&lt;BR /&gt;If you have a bit more complicated model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Sometimes you need fixed Totals as well:&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DESIRED YearVolume (Fixed Totals) = 
VAR isInSc_Prod = ISINSCOPE(dimProduct[idProduct])
VAR isInSc_Year = ISINSCOPE('Calendar'[Year])
VAR Result =
    SWITCH(
        TRUE(),
        NOT isInSc_Prod &amp;amp;&amp;amp; NOT isInSc_Year, 
            CALCULATE([DESIRED YearVolume],REMOVEFILTERS(dimProduct[idProduct]),REMOVEFILTERS('Calendar'[Year])),
        NOT isInSc_Prod, CALCULATE([DESIRED YearVolume], REMOVEFILTERS(dimProduct[idProduct])),
        NOT isInSc_Year, CALCULATE([DESIRED YearVolume], REMOVEFILTERS('Calendar'[Year])),
        [DESIRED YearVolume]
    )

RETURN Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;P.S. I'd appreciate if you support&amp;nbsp;&lt;STRONG&gt;"PowerQuery: Special symbol for previous step name"&amp;nbsp;&lt;/STRONG&gt;request feature by your vote&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://ideas.powerbi.com/ideas/idea/?ideaid=899b60b0-5c51-ed11-97b4-0003ff453d67" target="_self" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;or/and LinkedIn like/repost&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://www.linkedin.com/posts/denis-sipchenko_powerquery-powerbi-powerquery-activity-7000445277664907264-2z1z?utm_source=share&amp;amp;utm_medium=member_desktop" target="_self" rel="nofollow noopener noreferrer"&gt;here.&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 06:16:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3152717#M112987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-27T06:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Calculation of Facts/Values from Dimensional Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3155490#M113175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your sharing. Please kindly accept your workaround as the solution. Then more people will see your post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 08:26:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3155490#M113175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-27T08:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Calculation of Facts/Values from Dimensional Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3159057#M113389</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how about&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;DESIRED YearVolume 2 = 
SUMX (
    SUMMARIZE ( 
        factSales, dimSalesYearly[idYearProduct], 
        "@Volume", SUM ( dimSalesYearly[YearVolume] ) 
    ),
    [@Volume]  
)&lt;/LI-CODE&gt;
&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 05:19:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3159057#M113389</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-29T05:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Calculation of Facts/Values from Dimensional Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3159120#M113395</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;I came up with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
    VAR __idYearProduct = DISTINCT('factSales'[*idYearProduct])
    VAR __Result = SUMX(FILTER(ALL('dimSalesYearly'), [idYearProduct] IN __idYearProduct), [YearVolume])
RETURN
    __Result&lt;/LI-CODE&gt;&lt;P&gt;Or, you know, make the relationship bi-directional would work as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 18:01:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3159120#M113395</guid>
      <dc:creator>NotGregDeckler</dc:creator>
      <dc:date>2023-03-28T18:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Calculation of Facts/Values from Dimensional Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3160363#M113472</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465760" data-lia-user-login="NotGregDeckler" class="lia-mention lia-mention-user"&gt;NotGregDeckler&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Unbelievable!&lt;BR /&gt;Absoulutely different thinking style &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;I updated Source file with your solutions.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you very much!&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;P.S.&lt;/STRONG&gt; Not clear from this discussion branch, but I asked&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465760" data-lia-user-login="NotGregDeckler" class="lia-mention lia-mention-user"&gt;NotGregDeckler&lt;/a&gt;&amp;nbsp;in this &lt;A href="https://www.linkedin.com/posts/denis-sipchenko_proper-calculation-of-factsvalues-from-dimensional-activity-7046052100241252353-tVaR?utm_source=share&amp;amp;utm_medium=member_desktop" target="_self"&gt;post&lt;/A&gt;, if it's possible to create this measure without explicite use of CALCULATE function according to &lt;A href="https://www.youtube.com/watch?v=meh3OkgFYfc&amp;amp;list=PLoibEIc7heYNZbnY4CTCtg2tjEcMh8WbZ&amp;amp;ab_channel=MicrosoftHatesGreg" target="_self"&gt;DAX is easy,&amp;nbsp;CALCULATE makes DAX hard&lt;/A&gt;&amp;nbsp;phylosophy.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 13:29:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Proper-Calculation-of-Facts-Values-from-Dimensional-Table/m-p/3160363#M113472</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-30T13:29:13Z</dc:date>
    </item>
  </channel>
</rss>

