<?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: Sum of measures containing 'All' in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3243865#M119427</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting and desensitized example data.&lt;/P&gt;
&lt;P&gt;Thanks for your efforts &amp;amp; time in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2023 07:56:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-05-19T07:56:11Z</dc:date>
    <item>
      <title>Sum of measures containing 'All'</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3240175#M119193</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I am making a Power BI report, where the goal is to calculate the difference between a "global" grouped average and the value of the single orderline, called 'Lost Saving'.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am working in a database, and it is protected by Row Level Security, so to surpass this, we have created a new table every row has been duplicated, so it now contains a line with "personal" information and a cloned line stripped of every relation to any personal information. Every member would be able to see the anonymous lines, but only the "personal" lines appurtenant to their corporate.&lt;BR /&gt;&lt;BR /&gt;This is the code I use to get the total value spend on a given product (travel), across all corporates (by using the "fake" corporate 'Anonymous'.&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'Air Orderline Benchmark Data'&lt;/SPAN&gt;&lt;SPAN&gt;[VendorValueDKK]&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'Air Orderline Benchmark Data'&lt;/SPAN&gt;&lt;SPAN&gt;[VendorValueDKKVAT]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Corporate&lt;/SPAN&gt;&lt;SPAN&gt;[CorporateName]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;Corporate&lt;/SPAN&gt;&lt;SPAN&gt;[CorporateName]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Anonymous"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Air Orderline Benchmark Data'&lt;/SPAN&gt;&lt;SPAN&gt;[OrderlineNo]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Requester&lt;/SPAN&gt;&lt;SPAN&gt;[RequesterFullName]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;All&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Corporate&lt;/SPAN&gt;&lt;SPAN&gt;[CountryName]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Air Orderline Benchmark Data'&lt;/SPAN&gt;&lt;SPAN&gt;[DaysPresale]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Air Orderline Benchmark Data'&lt;/SPAN&gt;&lt;SPAN&gt;[PolicyOrderTimeDays]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Corporate&lt;/SPAN&gt;&lt;SPAN&gt;[EntityName]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Traveller&lt;/SPAN&gt;&lt;SPAN&gt;[TravellerFullName]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;This works, and by applying the same procedure I can also get a tally of how many times this "product" has been bought, and by that get the avg.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So I have succeeded "most" of the way, but when I, in the end, want to get the grand total of the 'Lost Saving' in a separate "card", I get a completely wrong answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I suspect it is due to the 'All' functions still affecting my calculation of the lost saving, but I do not know how to work around this.&lt;BR /&gt;So I kindly ask all you smart people for assistance, and I will try and provide additional information if needed.&lt;BR /&gt;BR Emil, the desperate BI Man &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 12:36:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3240175#M119193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T12:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of measures containing 'All'</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3243865#M119427</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting and desensitized example data.&lt;/P&gt;
&lt;P&gt;Thanks for your efforts &amp;amp; time in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 07:56:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3243865#M119427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-19T07:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of measures containing 'All'</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3243969#M119431</link>
      <description>&lt;P&gt;I can try &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;We are selling travels. And have a policy on how far in advance the tickets should be booked.&amp;nbsp;&lt;BR /&gt;We then want to show how much you "lose" by booking later than the policy.&lt;BR /&gt;To do this, we take your order and look at what route you flew, let's say London - NY, but booked late.&lt;BR /&gt;Then I want to make an average from all of our members who flew the route London - NY.&lt;BR /&gt;The difference between those two numbers is then the Lost Saving.&lt;BR /&gt;&lt;BR /&gt;What makes this problematic is, that the entire database is "protected" by RLS, so members from different companies can't see data, from other companies than their own.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As I wrote above, this has been worked around, by cloning all orders, but this time with no information of company, name etc, so anonymous data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made all the calculations work, besides getting the right sum, both in the tabel and in a card.&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example I just want it to sum 434 + 2569 = 3003 and not = 4030&lt;BR /&gt;(Worth mentioning that to get the global avg, I am subtracting that specific order)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't know how to best do a desensitized example data set, since it is data from 4 different tables all connected. But if you have an idea to do so, please let me know, and I will do that, and provide it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 08:58:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3243969#M119431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-19T08:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of measures containing 'All'</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3249077#M119820</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Because the information limit, i will try my best to give you the solution.&lt;/P&gt;
&lt;P&gt;According to your description, the problem is the total sum not correct, i assume "Routing_Id_debtorHome_Name_Sorted" is a field, "Lost Savings" is a measure.&lt;/P&gt;
&lt;P&gt;Please try below dax formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Adjust Lost Savings =
SUMX ( VALUES ( [Routing_Id_debtorHome_Name_Sorted] ), [Lost Savings] )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 06:47:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-measures-containing-All/m-p/3249077#M119820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-23T06:47:54Z</dc:date>
    </item>
  </channel>
</rss>

