<?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: % compared to 1 row in Matrix in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945792#M10345</link>
    <description>&lt;P&gt;Hi there.&lt;BR /&gt;&lt;BR /&gt;First, I'd advise you should create correct models. A correct model is a star schema (or snowflake if star can't be achieved). Second, fact tables should only store numbers to aggregate and keys to dimensions. All columns in fact tables must be hidden without exception. Third, all time-based analysis must be carried out through proper Data tables. Then and only then will you be able to write correct and SIMPLE DAX against your model. Otherwise... be prepared to produce numbers you will not be able to understand and even know you're producing falsehood.&lt;BR /&gt;&lt;BR /&gt;My formula certainly does what it should on a proper model. I'd like to see your model and data to find the reason why it does not give you what you want. Can you please share a file with some sample data and tell us what the results should be for the data?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2020 18:44:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-24T18:44:37Z</dc:date>
    <item>
      <title>% compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945693#M10337</link>
      <description>&lt;P&gt;Hi People,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a P&amp;amp;L with a column that shows the % of production compared to the other rows in the matrix.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;This month&lt;/TD&gt;&lt;TD&gt;% in relation to production&lt;/TD&gt;&lt;TD&gt;YTD&lt;/TD&gt;&lt;TD&gt;% in relation to production&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Production&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Machine cost&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;5%&lt;/TD&gt;&lt;TD&gt;75&lt;/TD&gt;&lt;TD&gt;3,75%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Personel cost&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;TD&gt;25%&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;50%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Other cost&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;10%&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;10%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I tried to use All to get an absolute value but this does not work because i Need to be able to filter on month and with my All formula I only was able to get the grand total of the whole year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you can help me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 17:41:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945693#M10337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T17:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945713#M10338</link>
      <description>&lt;LI-CODE lang="markup"&gt;[% of Production] =
var __production =
	CALCULATE(
		[Measure],
		Table[Branch] = "production"
	)
var __current = [Measure]
return
	DIVIDE(__current, __production)&lt;/LI-CODE&gt;
&lt;P&gt;You have not given us the names of the tables and columns... so please figure out the generics by yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 17:50:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945713#M10338</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T17:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945769#M10344</link>
      <description>&lt;P&gt;Hi Sorry for the incomplete information.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunatly the sollution does not work. It gives me&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;This month&lt;/TD&gt;&lt;TD&gt;% in relation to production&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Production&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Machine cost&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Personel cost&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Other cost&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I have created a Measure for this Month which is very simple =sum(transactiontable[amount]&lt;/P&gt;&lt;P&gt;I have also created a production measure =Calculate(sumx(transactiontable[amount]; transactiontable[description = "production"&lt;/P&gt;&lt;P&gt;I keep running into the problem that the other rows in the matrix are based on the other descriptions and therefore I cannot get "production"into that row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data comes out of a large transactional table. like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this clears it up.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;production&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;1-1-2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Production&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;1-1-2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;machine cost&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1-1-2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;machine cost&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;15-2-2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Other Cost&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;5-3-2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;etc&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 24 Feb 2020 18:29:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945769#M10344</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T18:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945792#M10345</link>
      <description>&lt;P&gt;Hi there.&lt;BR /&gt;&lt;BR /&gt;First, I'd advise you should create correct models. A correct model is a star schema (or snowflake if star can't be achieved). Second, fact tables should only store numbers to aggregate and keys to dimensions. All columns in fact tables must be hidden without exception. Third, all time-based analysis must be carried out through proper Data tables. Then and only then will you be able to write correct and SIMPLE DAX against your model. Otherwise... be prepared to produce numbers you will not be able to understand and even know you're producing falsehood.&lt;BR /&gt;&lt;BR /&gt;My formula certainly does what it should on a proper model. I'd like to see your model and data to find the reason why it does not give you what you want. Can you please share a file with some sample data and tell us what the results should be for the data?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 18:44:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945792#M10345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T18:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945825#M10347</link>
      <description>&lt;P&gt;The measure works perfectly OK. [Total Amount] is the sum of the Amount column in the Transaction table you see below.&lt;/P&gt;
&lt;DIV id="tinyMceEditordarlove_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Feb 2020 19:07:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945825#M10347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T19:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945870#M10348</link>
      <description>&lt;P&gt;Hi Darlove,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have re-created it and tested. You are right. It does work, but when I create the matrix from a categorie table it does not work. I Have made an example pbx file to show you and am trying to get it up here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 19:46:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945870#M10348</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T19:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945882#M10349</link>
      <description>&lt;P&gt;Zie the file&amp;nbsp;&lt;BR /&gt;&lt;A title="examble" href="https://koenenenco-my.sharepoint.com/:u:/g/personal/b_kessels_koenenenco_nl/EdnhfyTnrkVOh-WTLZto2g4BrZhEVUs0ZRfHSE9gT-nFqg?e=a7zKci" target="_blank" rel="noopener"&gt;Example PBX&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 19:54:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/945882#M10349</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T19:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/946878#M10403</link>
      <description>&lt;P&gt;Mate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, please let these golden rules of data modeling sink in well:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial black,avant garde" style="--darkreader-inline-color: #934140;" color="#FF0000" data-darkreader-inline-color=""&gt;Fact tables should never be exposed to the user. NEVER, EVER. All columns in them MUST be hidden unconditionally. Slicing is only ever done through dimensions.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second of all, here's the measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% prod 2 = 
var __current = [Sum amount]
var __prod =
    CALCULATE(
        [Sum amount],
        categories[Group] = "production",
        all(categories)
    )
return
    DIVIDE(__current, __prod)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this is what you've been looking for...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the future. Please try to learn as much as possible about good design and data modeling practices. It'll help you avoid pitfalls and production of numbers you will not be able to explain. Just a piece of good advice from a BI old-timer. You'll thank me later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 10:03:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/946878#M10403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-25T10:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/954783#M10885</link>
      <description>&lt;P&gt;Thanks for your answer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;you are a strickt teacher &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 07:33:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/954783#M10885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T07:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: % compared to 1 row in Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/954941#M10892</link>
      <description>Anonymous&lt;/LI-USER&gt;, which teacher would you rather have: one that smiles at you constantly, cuddles up to you and knows about the subject just a tiny bit... or rather one that is strict but from which you can truly learn the art? Think about martial arts - the best masters are the ones that require of you a superhuman effort &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 02 Mar 2020 09:11:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compared-to-1-row-in-Matrix/m-p/954941#M10892</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T09:11:55Z</dc:date>
    </item>
  </channel>
</rss>

