<?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: Division based on 2 other values from different columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207781#M116902</link>
    <description>&lt;P&gt;My apologies, I used the wrong data anyway.&lt;BR /&gt;&lt;BR /&gt;Please see the following Dax:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It should be returning 67.5%, but it is returning 77.1%&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;Completed ticket data:&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;Timestudydata:&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;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Apr 2023 17:43:16 GMT</pubDate>
    <dc:creator>nicklabh</dc:creator>
    <dc:date>2023-04-26T17:43:16Z</dc:date>
    <item>
      <title>Division based on 2 other values from different columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3205460#M116736</link>
      <description>&lt;P&gt;Hi everyone, I am very new to DAX and the purpose of using Pbi is to model data for our manufacturing production control.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have collected data for the below:&lt;BR /&gt;&lt;BR /&gt;-Time study data ( Machine, Material #, Pieces/Hr) "Look up table"&lt;/P&gt;&lt;P&gt;-Completed work ticket data (Machine, Material #, [Measure: Pieces/Hr])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our material# profiles can run on different machines but has different pieces/hr. Goal is to make a simple calculation by dividing pieces/hr(Completed work ticket data) with pieces/hr (Time study data). Returning production efficiency based on material# and machines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently relationship between the 2 tables are many to many for "material #" and "machine". If i use SUM for the time study data, it will sum all machines producing the same profile. If I use average for the time study data, it will only return an average value for all machines producing the same profile. How could I fix that??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;**As you can see, highlighted have same profile but different machine&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;*Current relationship&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 15:50:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3205460#M116736</guid>
      <dc:creator>nicklabh</dc:creator>
      <dc:date>2023-04-25T15:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Division based on 2 other values from different columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3205706#M116749</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="551289" data-lia-user-login="nicklabh" class="lia-mention lia-mention-user"&gt;nicklabh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;easiest approach is to create a new column in both tables which is the concatenation of Machine and Material # columns that would be a primary key i the dimension (lookup table) and will enable the creation of one to many relationship. Then youe measure would simply be&lt;/P&gt;
&lt;P&gt;DivisionMeasure =&lt;BR /&gt;AVERAGEX ( TimeStudyRawDat, DIVIDE ( [Prices/HR], TimeStudyRawDat[Prices/HR] ) )&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 19:13:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3205706#M116749</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-25T19:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Division based on 2 other values from different columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207768#M116899</link>
      <description>&lt;P&gt;Hi tamerj1, thank you for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added the concate column and now it is relationship in 1 to many. However the formula is not producing the correct % calculation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Completed ticket data table exist measure pieces/Hr for each line&lt;/LI&gt;&lt;LI&gt;Timestudyraw data table exist pieces/Hr&lt;/LI&gt;&lt;/UL&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;Timestudyraw data table (64 pieces/hr)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Completed ticket data table (Average 40.5 pieces/hr)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Correct calcuation is 40.5/64 = 63%&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;However, the current calculation is&lt;BR /&gt;&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;</description>
      <pubDate>Wed, 26 Apr 2023 17:31:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207768#M116899</guid>
      <dc:creator>nicklabh</dc:creator>
      <dc:date>2023-04-26T17:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Division based on 2 other values from different columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207774#M116900</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="551289" data-lia-user-login="nicklabh" class="lia-mention lia-mention-user"&gt;nicklabh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can please copy/paste the dax? It is not clear in the screenshot. Why do you need to use LOOKUPVALUE?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 17:37:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207774#M116900</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-26T17:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Division based on 2 other values from different columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207781#M116902</link>
      <description>&lt;P&gt;My apologies, I used the wrong data anyway.&lt;BR /&gt;&lt;BR /&gt;Please see the following Dax:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It should be returning 67.5%, but it is returning 77.1%&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;Completed ticket data:&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;Timestudydata:&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;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 17:43:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207781#M116902</guid>
      <dc:creator>nicklabh</dc:creator>
      <dc:date>2023-04-26T17:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Division based on 2 other values from different columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207860#M116909</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="551289" data-lia-user-login="nicklabh" class="lia-mention lia-mention-user"&gt;nicklabh&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;In your visual you should&amp;nbsp;be using the [Material #] from the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;TimeStudyRawDat&lt;/STRONG&gt; table (&lt;U&gt;the dimension&amp;nbsp;table&lt;/U&gt;). Then apply the following measure.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note: Please do not use LOOKUPVALUE, as it is an inefficient FUNCTION and proves useless in many scenarios.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Production Efficiency =
AVERAGEX (
    TimeStudyRawDat,
    DIVIDE (
        AVERAGE ( 'Completed Ticket Data'[Pieces/Hr] ),
        TimeStudyRawDat[Prices/HR]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 19:03:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Division-based-on-2-other-values-from-different-columns/m-p/3207860#M116909</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-26T19:03:10Z</dc:date>
    </item>
  </channel>
</rss>

