<?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: multi levels calculations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4305738#M170965</link>
    <description>&lt;P&gt;post updated : file added&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2024 08:23:26 GMT</pubDate>
    <dc:creator>nicnic38</dc:creator>
    <dc:date>2024-11-28T08:23:26Z</dc:date>
    <item>
      <title>multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4304047#M170906</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'd like to calculate complex (for me) calculation to obtain specific results.&lt;/P&gt;&lt;P&gt;The aim is to avoid temporary table in order to calculate whatever the selection of the data is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data has 3 levels : group, subgroup1, subgroup2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in my exemple, i put&amp;nbsp; :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; -2 groups (but there will be 50) : B is the reference group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - theses groups are divided into 3 groups (subgroup1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - inside subgroup1 there are 4 groups (subgroup2).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;S1&lt;/STRONG&gt; &lt;/U&gt;: My first calculations (total) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;U&gt;step 1&lt;/U&gt; : attribute the average price (total price / sales) of A to the sales of B :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;U&gt;step 2 &lt;/U&gt;: calculate the theorical total price of A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;U&gt;step 3&lt;/U&gt; : calculate the difference between the theorical total price of A and the total price of B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;S2 :&lt;/U&gt;&lt;/STRONG&gt; My seconds calculations (by subgroup):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; step 4 : attribute the average price value of subgroup of A (2 and 3) to the sales of B (2 and 3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; step 5 : sum each total of the subgroup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; step 6 : calculate the difference between the total of subgroup A and the total of subgroup B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;S3 :&lt;/U&gt;&lt;/STRONG&gt; My thirds calculations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; step 7 : calculate the difference between my 2 first calculations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; step 8 : keep only one line per group (A and B).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance for help.&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the file (simplifyed) to work with : &lt;A href="https://drive.google.com/file/d/1i9SYQE0fllQw2Bs6NxglxXTgxUPy0MHU/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1i9SYQE0fllQw2Bs6NxglxXTgxUPy0MHU/view?usp=sharing&lt;/A&gt;&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;</description>
      <pubDate>Fri, 29 Nov 2024 10:34:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4304047#M170906</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-11-29T10:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4304869#M170936</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 21:51:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4304869#M170936</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-11-27T21:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4305738#M170965</link>
      <description>&lt;P&gt;post updated : file added&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 08:23:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4305738#M170965</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-11-28T08:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4305748#M170966</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="864151" data-lia-user-login="nicnic38" class="lia-mention lia-mention-user"&gt;nicnic38&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for&amp;nbsp;lbendlin's reply. You can try following measure to solve your need.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;average price = 
VAR _group = SELECTEDVALUE('Table'[Group])
VAR _subgroup1 = SELECTEDVALUE('Table'[Subgroup1])
VAR _subgroup2 = SELECTEDVALUE('Table'[Subgroup2])
VAR _sales = SELECTEDVALUE('Table'[Sales])
VAR _totalProce = CALCULATE(SUM('Table'[Total price]),ALLEXCEPT('Table','Table'[Group],'Table'[Subgroup1]))
RETURN
VAR _totalSales = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Group],'Table'[Subgroup1]))
RETURN
DIVIDE(_totalProce,_totalSales)

average price diff_group = 
VAR _group = SELECTEDVALUE('Table'[Group])
VAR _subgroup1 = SELECTEDVALUE('Table'[Subgroup1])
VAR _subgroup2 = SELECTEDVALUE('Table'[Subgroup2])
VAR _sales = SELECTEDVALUE('Table'[Sales])
VAR _totalProce = CALCULATE(SUM('Table'[Total price]),ALLEXCEPT('Table','Table'[Group]))
RETURN
VAR _totalSales = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Group]))
RETURN
DIVIDE(_totalProce,_totalSales)

Sales(B) 1 = 
VAR _totalSales_B = CALCULATE(SUM('Table'[Sales]),'Table'[Group] = "B",ALLEXCEPT('Table','Table'[Group]))
VAR _totalSales_all = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Group]))
RETURN
IF(SELECTEDVALUE('Table'[Group]) = "A",_totalSales_B,_totalSales_all)

Sales(B) 2 = 
VAR _totalSales_B = CALCULATE(SUM('Table'[Sales]),'Table'[Group] = "B",ALLEXCEPT('Table','Table'[Group],'Table'[Subgroup1]))
VAR _totalSales_all = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Group],'Table'[Subgroup1]))
RETURN
IF(SELECTEDVALUE('Table'[Group]) = "A",_totalSales_B,_totalSales_all)

Calculation 1 = 
VAR _averagePrice_Sales = [average price diff_group] * [Sales(B) 1]
VAR _A_calculate = CALCULATE([average price diff_group] * [Sales(B) 1],'Table'[Group] = "A")
VAR _B_calculate = CALCULATE([average price diff_group] * [Sales(B) 1],'Table'[Group] = "B")
RETURN
_A_calculate - _B_calculate

Calculation 2 = 
VAR _calculate2 = [average price] * [Sales(B) 2]
VAR _A_2_calculate = CALCULATE([average price] * [Sales(B) 2],'Table'[Group] = "A" &amp;amp;&amp;amp; 'Table'[Subgroup1] = 2)
VAR _A_3_calculate = CALCULATE([average price] * [Sales(B) 2],'Table'[Group] = "A" &amp;amp;&amp;amp; 'Table'[Subgroup1] = 3)
VAR _B_2_calculate = CALCULATE([average price] * [Sales(B) 2],'Table'[Group] = "B" &amp;amp;&amp;amp; 'Table'[Subgroup1] = 2)
VAR _B_3_calculate = CALCULATE([average price] * [Sales(B) 2],'Table'[Group] = "B" &amp;amp;&amp;amp; 'Table'[Subgroup1] = 3)
RETURN
_A_2_calculate + _A_3_calculate - _B_2_calculate - _B_3_calculate

Calculation 3 = [Calculation 2] - [Calculation 1]
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P style="text-align: justify; text-justify: inter-ideograph;"&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;Yang&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Community Support Team&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="text-align: justify; text-justify: inter-ideograph;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;If there is any post &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Accept it as the solution&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know. &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;U&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365912356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7IzyI2%2FMOAR%2FYCjWYSKCZL2VPmT4PsxuWBjdUdMWKzo%3D&amp;amp;reserved=0" target="_blank"&gt;How to get your questions answered quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;-- &lt;/SPAN&gt;&lt;U&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7Cv-yaningyang%40microsoft.com%7C326a6d727194478c197008dbefc04904%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638367381365919045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=VeafzdwAsrpisD8s261%2FdyOwJ1aCtBXS3bPA6NODOHY%3D&amp;amp;reserved=0" target="_blank"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 08:25:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4305748#M170966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-28T08:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4305839#M170973</link>
      <description>&lt;P&gt;look great... for my sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my dataset is much more complex :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - "group" has 50 values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - "subgroup1" has more than 200 values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - "subgroup2" has from 4 to 10 values dependnaing on the value of subgroup1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again for help&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 09:04:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4305839#M170973</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-11-28T09:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306292#M170991</link>
      <description>&lt;P&gt;Please provide sample data &lt;STRONG&gt;that fully covers your issue&lt;/STRONG&gt;.&lt;BR /&gt;Please show the expected outcome based on the sample data you provided.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 13:26:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306292#M170991</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-11-28T13:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306438#M171005</link>
      <description>&lt;P&gt;here is the dataset : &lt;A href="https://drive.google.com/file/d/1DS44dI23jA_YRSB_JqXSiGyqa4J5HmUW/view?usp=drive_link" target="_blank"&gt;https://drive.google.com/file/d/1DS44dI23jA_YRSB_JqXSiGyqa4J5HmUW/view?usp=drive_link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:43:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306438#M171005</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-11-29T07:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306457#M171008</link>
      <description>&lt;P&gt;Access denied.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 15:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306457#M171008</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-11-28T15:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306469#M171009</link>
      <description>&lt;P&gt;the data file is updated&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 16:07:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306469#M171009</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-11-28T16:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306553#M171014</link>
      <description>&lt;P&gt;still access denied - please check the sharing settings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 18:11:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4306553#M171014</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-11-28T18:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4307204#M171034</link>
      <description>&lt;P&gt;link updated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:44:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4307204#M171034</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-11-29T07:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4307284#M171048</link>
      <description>&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1DS44dI23jA_YRSB_JqXSiGyqa4J5HmUW/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1DS44dI23jA_YRSB_JqXSiGyqa4J5HmUW/view?usp=sharing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 08:55:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4307284#M171048</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-11-29T08:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4308072#M171096</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;step 1 : attribute the average price (total price / sales) of A to the sales of B :&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see that you have lines with multiple sales.&amp;nbsp; That means you cannot just divide the total price by sales.&amp;nbsp; You would have to identify the price of an individual sale and then average that out across all sales.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is your definition of "average price"&amp;nbsp; and why?&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;</description>
      <pubDate>Fri, 29 Nov 2024 22:33:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4308072#M171096</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-11-29T22:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4309466#M171141</link>
      <description>&lt;P&gt;average price = total price / sales for each group (A, B, C, D).&lt;/P&gt;&lt;P&gt;the aim is to "standardized" the total price by using the reference of group B.&lt;/P&gt;&lt;P&gt;You will have the total price of A or C or D if you have the sales of B&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 11:33:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4309466#M171141</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-12-03T11:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4311871#M171242</link>
      <description>&lt;P&gt;I finalize the calculation 1 :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales(B) 1 =&lt;BR /&gt;var mes_racines = ALLSELECTED(data_web2024m6[subgroup1])&lt;BR /&gt;var mes_durees = ALLSELECTED(data_web2024m6[var_d])&lt;BR /&gt;var mes_annees = ALLSELECTED(data_web2024m6[annee])&lt;BR /&gt;var mes_adultes = ALLSELECTED(data_web2024m6[var_a])&lt;BR /&gt;var mes_hosp = ALLSELECTED(data_web2024m6[var_h])&lt;BR /&gt;var mes_urg = ALLSELECTED(data_web2024m6[var_u])&lt;BR /&gt;var _totalSales_B =&lt;BR /&gt;CALCULATE(SUM(data_web2024m6[sales]),data_web2024m6[group] = "B",&lt;BR /&gt;data_web2024m6[subgroup1] in mes_racines,&lt;BR /&gt;data_web2024m6[var_a] in mes_adultes,&lt;BR /&gt;data_web2024m6[var_h] in mes_hosp,&lt;BR /&gt;data_web2024m6[annee] in mes_annees,&lt;BR /&gt;data_web2024m6[var_d] in mes_durees,&lt;BR /&gt;data_web2024m6[var_u] in mes_urg,&lt;BR /&gt;ALLEXCEPT(data_web2024m6,data_web2024m6[group]))&lt;BR /&gt;VAR _totalSales_all = CALCULATE(SUM(data_web2024m6[sales]),&lt;BR /&gt;data_web2024m6[subgroup1] in mes_racines,&lt;BR /&gt;data_web2024m6[var_a] in mes_adultes,&lt;BR /&gt;data_web2024m6[var_h] in mes_hosp,&lt;BR /&gt;data_web2024m6[annee] in mes_annees,&lt;BR /&gt;data_web2024m6[var_d] in mes_durees,&lt;BR /&gt;data_web2024m6[var_u] in mes_urg,&lt;BR /&gt;ALLEXCEPT(data_web2024m6,data_web2024m6[group]))&lt;BR /&gt;RETURN&lt;BR /&gt;IF(SELECTEDVALUE(data_web2024m6[group]) &amp;lt;&amp;gt; "B",_totalSales_B,_totalSales_all)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;pmct(B) 1 =&lt;BR /&gt;var mes_racines = ALLSELECTED(data_web2024m6[subgroup1])&lt;BR /&gt;var mes_durees = ALLSELECTED(data_web2024m6[var_d])&lt;BR /&gt;var mes_annees = ALLSELECTED(data_web2024m6[annee])&lt;BR /&gt;var mes_adultes = ALLSELECTED(data_web2024m6[var_a])&lt;BR /&gt;var mes_hosp = ALLSELECTED(data_web2024m6[var_h])&lt;BR /&gt;var mes_urg = ALLSELECTED(data_web2024m6[var_u])&lt;BR /&gt;VAR pmct1 = CALCULATE(CALCULATE(SUM(data_web2024m6[total_price]),&lt;BR /&gt;data_web2024m6[subgroup1] in mes_racines,&lt;BR /&gt;data_web2024m6[var_a] in mes_adultes,&lt;BR /&gt;data_web2024m6[var_h] in mes_hosp,&lt;BR /&gt;data_web2024m6[var_d] in mes_durees,&lt;BR /&gt;data_web2024m6[annee] in mes_annees,&lt;BR /&gt;data_web2024m6[var_u] in mes_urg,&lt;BR /&gt;ALLEXCEPT(data_web2024m6,data_web2024m6[group]))&lt;BR /&gt;/&lt;BR /&gt;CALCULATE(SUM(data_web2024m6[sales]),&lt;BR /&gt;data_web2024m6[subgroup1] in mes_racines,&lt;BR /&gt;data_web2024m6[var_a] in mes_adultes,&lt;BR /&gt;data_web2024m6[var_d] in mes_durees,&lt;BR /&gt;data_web2024m6[var_h] in mes_hosp,&lt;BR /&gt;data_web2024m6[annee] in mes_annees,&lt;BR /&gt;data_web2024m6[var_u] in mes_urg,&lt;BR /&gt;ALLEXCEPT(data_web2024m6,data_web2024m6[group])))&lt;BR /&gt;RETURN&lt;BR /&gt;pmct1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sales(B) 1 =&lt;BR /&gt;var mes_racines = ALLSELECTED(data_web2024m6[subgroup1])&lt;BR /&gt;var mes_durees = ALLSELECTED(data_web2024m6[var_d])&lt;BR /&gt;var mes_annees = ALLSELECTED(data_web2024m6[annee])&lt;BR /&gt;var mes_adultes = ALLSELECTED(data_web2024m6[var_a])&lt;BR /&gt;var mes_hosp = ALLSELECTED(data_web2024m6[var_h])&lt;BR /&gt;var mes_urg = ALLSELECTED(data_web2024m6[var_u])&lt;BR /&gt;var _totalSales_B =&lt;BR /&gt;CALCULATE(SUM(data_web2024m6[sales]),data_web2024m6[group] = "B",&lt;BR /&gt;data_web2024m6[subgroup1] in mes_racines,&lt;BR /&gt;data_web2024m6[var_a] in mes_adultes,&lt;BR /&gt;data_web2024m6[var_h] in mes_hosp,&lt;BR /&gt;data_web2024m6[annee] in mes_annees,&lt;BR /&gt;data_web2024m6[var_d] in mes_durees,&lt;BR /&gt;data_web2024m6[var_u] in mes_urg,&lt;BR /&gt;ALLEXCEPT(data_web2024m6,data_web2024m6[group]))&lt;BR /&gt;VAR _totalSales_all = CALCULATE(SUM(data_web2024m6[sales]),&lt;BR /&gt;data_web2024m6[subgroup1] in mes_racines,&lt;BR /&gt;data_web2024m6[var_a] in mes_adultes,&lt;BR /&gt;data_web2024m6[var_h] in mes_hosp,&lt;BR /&gt;data_web2024m6[annee] in mes_annees,&lt;BR /&gt;data_web2024m6[var_d] in mes_durees,&lt;BR /&gt;data_web2024m6[var_u] in mes_urg,&lt;BR /&gt;ALLEXCEPT(data_web2024m6,data_web2024m6[group]))&lt;BR /&gt;RETURN&lt;BR /&gt;IF(SELECTEDVALUE(data_web2024m6[group]) &amp;lt;&amp;gt; "B",_totalSales_B,_totalSales_all)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;calculation1 =&lt;BR /&gt;VAR _A_calculate = CALCULATE([valo_std(B) 1])&lt;BR /&gt;VAR _B_calculate = CALCULATE([valo_std(B) 1],data_web2024m6[group] = "B")&lt;BR /&gt;RETURN&lt;BR /&gt;_A_calculate - _B_calculate&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 15:08:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4311871#M171242</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-12-03T15:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: multi levels calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4314837#M171331</link>
      <description>&lt;P&gt;still calculation 2 ans calculation 3 to do &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 07:37:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/multi-levels-calculations/m-p/4314837#M171331</guid>
      <dc:creator>nicnic38</dc:creator>
      <dc:date>2024-12-05T07:37:17Z</dc:date>
    </item>
  </channel>
</rss>

