<?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: Weighted AVG DAX calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787943#M87464</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I got confused. I edited the code again please check. Again we are creating the column in sheet1 and all related columns are in sheet2&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2022 19:59:57 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-09-22T19:59:57Z</dc:date>
    <item>
      <title>Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774381#M86527</link>
      <description>&lt;P&gt;Hi All -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is basically where i pick the fields needed from two tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My error is coming from the "Sheet1" table where it flags the field with red line. On looking up the meaning of the error : &lt;STRONG&gt;"A single value of column 'Market_Price' in table 'Sheet1' cannot be determined. This can happenwhen measure formula refers to a column that contains many values without specifyingan aggregation such as min, max, count, or sum to get a single result".&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my formula but not sure what I am missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Weighted Avg =&lt;BR /&gt;DIVIDE ( SUMX ( FILTER ( Sheet2, Sheet2[HAS_Analytics] = 1 &amp;amp;&amp;amp; Sheet1[Market_Price] &amp;lt;&amp;gt; BLANK () ),Sheet1[Market_Value] * Sheet1[Market_Price] ),&lt;BR /&gt;SUMX ( FILTER ( Sheet2, Sheet2[HAS_Analytics] = 1 &amp;amp;&amp;amp; Sheet1[Market_Price] &amp;lt;&amp;gt; BLANK () ), Sheet1[Market_Value] ) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 18:54:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774381#M86527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-16T18:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774411#M86530</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Weighted Avg =
VAR T1 =
    ADDCOLUMNS ( Sheet2, "@MarketPrice", RELATED ( Sheet1[Market_Price] ) )
VAR T2 =
    FILTER ( T1, [HAS_Analytics] = 1 &amp;amp;&amp;amp; [@MarketPrice] &amp;lt;&amp;gt; BLANK () )
RETURN
    DIVIDE (
        SUMX ( T2, [Market_Value] * [@MarketPrice] ),
        SUMX ( T2, [Market_Value] )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 19:09:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774411#M86530</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-16T19:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774436#M86534</link>
      <description>&lt;P&gt;Hi Tamerj - Thank you for the response. I'm still getting the same error on [Market_Price]&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 19:20:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774436#M86534</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-16T19:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774759#M86552</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what is the relationship between the two tables?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 02:37:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2774759#M86552</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-17T02:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787793#M87440</link>
      <description>&lt;P&gt;Hi Tamerj-&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;</description>
      <pubDate>Thu, 22 Sep 2022 18:23:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787793#M87440</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T18:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787798#M87442</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your example, which one is table sheet1? Also please confirm that the relationship is one to many single way&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 18:28:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787798#M87442</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T18:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787809#M87443</link>
      <description>&lt;P&gt;Sorry, I mistakenly clicked "Accepted Solution"&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, the relationship is many to single way.&lt;/P&gt;&lt;P&gt;Sheet1 =&amp;nbsp;POSITION_FACT_WH&lt;/P&gt;&lt;P&gt;Sheet2 =&amp;nbsp;SECURITY_DIM_WH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 18:35:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787809#M87443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T18:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787812#M87444</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you have many values of the market price related to each row of the security dim table. Which value would you like to retrieve? The max, min, latest or sum?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 18:39:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787812#M87444</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T18:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787818#M87446</link>
      <description>&lt;P&gt;The Sum.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 18:44:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787818#M87446</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T18:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787826#M87450</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Weighted Avg =
VAR T1 =
    ADDCOLUMNS (
        Sheet2,
        "@MarketPrice", SUMX ( RELATEDTABLE ( Sheet1 ), Sheet1[Market_Price] )
    )
VAR T2 =
    FILTER ( T1, [HAS_Analytics] = 1 &amp;amp;&amp;amp; [@MarketPrice] &amp;lt;&amp;gt; BLANK () )
RETURN
    DIVIDE (
        SUMX ( T2, [Market_Value] * [@MarketPrice] ),
        SUMX ( T2, [Market_Value] )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 22 Sep 2022 18:48:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787826#M87450</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T18:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787850#M87454</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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate your time. Still getting error. Can't find name [Market_Value]. The field is under Sheet1 table.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;T2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[&lt;STRONG&gt;Market_Value&lt;/STRONG&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;* &lt;/SPAN&gt;&lt;SPAN&gt;[@MarketPrice]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;T2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[&lt;STRONG&gt;Market_Value&lt;/STRONG&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:04:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787850#M87454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T19:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787852#M87455</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ok we can eliminate the error but now I'm not sure what are you trying to calculate. So we are creating a calculated column in sheet1 (dim table) using values from two columns from sheet2 (fact table). I guess you want to retrieve the sum of the division after filtering out the none blank market prices? Is that correct?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:14:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787852#M87455</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T19:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787860#M87456</link>
      <description>&lt;P&gt;Exactly! None blank [Market_Price] and while [HAS_Analytics] = 1&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:21:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787860#M87456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T19:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787861#M87457</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&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;LI-CODE lang="javascript"&gt;Weighted Avg =
VAR T1 =
    RELATEDTABLE ( Sheet2 )
VAR T2 =
    FILTER ( T1, Sheet2[Market_Price] &amp;lt;&amp;gt; BLANK () &amp;amp;&amp;amp; Sheet2[HAS_Analytics] = 1 )
RETURN
    SUMX (
        T2,
        DIVIDE ( Sheet2[Market_Value] * Sheet2[Market_Price], Sheet2[Market_Value] )
    )&lt;/LI-CODE&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;</description>
      <pubDate>Thu, 22 Sep 2022 20:10:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787861#M87457</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T20:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787864#M87458</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have edited the last solution adding the new filter (&lt;SPAN&gt;HAS_Analytics = 1)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:24:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787864#M87458</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T19:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787883#M87461</link>
      <description>&lt;P&gt;So, under the filter is 2 different tables and not just Sheet1. [Market_Price] should be filtered from Sheet2.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:35:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787883#M87461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T19:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787943#M87464</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I got confused. I edited the code again please check. Again we are creating the column in sheet1 and all related columns are in sheet2&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:59:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787943#M87464</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T19:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787961#M87468</link>
      <description>&lt;P&gt;Still under the filter --&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;FILTER ( T1, Sheet1[Market_Price] &amp;lt;&amp;gt; BLANK () &amp;amp;&amp;amp; Sheet2[HAS_Analytics] = 1 )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Suppose to be Sheet2[Market_Price]&amp;lt;&amp;gt;BlANK() &amp;amp;&amp;amp; Sheet1[HAS_Analytics]=1)&amp;nbsp;&lt;/P&gt;&lt;P&gt;But Im getting error here:&amp;nbsp;&lt;STRONG&gt;Sheet1[HAS_Analytics]&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 20:08:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787961#M87468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T20:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787965#M87469</link>
      <description>&lt;P&gt;&lt;SPAN&gt;HAS_Analytics In which table?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 20:11:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787965#M87469</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-22T20:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted AVG DAX calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787968#M87470</link>
      <description>&lt;P&gt;Sheet1 table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 20:12:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-AVG-DAX-calculation/m-p/2787968#M87470</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-22T20:12:04Z</dc:date>
    </item>
  </channel>
</rss>

