<?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: LOOKUPVALUE the right DAX? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053804#M14463</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226359" data-lia-user-login="ITManuel" class="lia-mention lia-mention-user"&gt;ITManuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try relating both tables and SUMX function.&lt;/P&gt;&lt;P&gt;So you can multiply the qty hours by hour rate in a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ricardo&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2020 14:06:46 GMT</pubDate>
    <dc:creator>camargos88</dc:creator>
    <dc:date>2020-04-28T14:06:46Z</dc:date>
    <item>
      <title>LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053790#M14462</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would like to analyze project and department related hours and costs from a data set from my ERP system. I have loaded two tables into my PBI file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;P&gt;Project&amp;nbsp; &amp;nbsp;Department&amp;nbsp; &amp;nbsp; Employee&amp;nbsp; &amp;nbsp; Date&amp;nbsp; &amp;nbsp; Work process&amp;nbsp; &amp;nbsp; &amp;nbsp;Hours&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;P&gt;Department&amp;nbsp; &amp;nbsp; &amp;nbsp; Hourly rate&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; X&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a Matrix which shows the sum of hours for each project and department. Now I would like to calculate the costs for each department taking into consideration the hourly rates contained in table 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the LOKKUPVALUE DAX as below, but can only use static search values such as "Engineering" for example.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;HR = LOOKUPVALUE(Departments[Hourly rate];Departments[Department Name];"Engineering")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would need variable search values to identify the hourly rates for each department and multiply it with the sum of hours in the matrix.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can somebody help please?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:02:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053790#M14462</guid>
      <dc:creator>ITManuel</dc:creator>
      <dc:date>2020-04-28T14:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053804#M14463</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226359" data-lia-user-login="ITManuel" class="lia-mention lia-mention-user"&gt;ITManuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try relating both tables and SUMX function.&lt;/P&gt;&lt;P&gt;So you can multiply the qty hours by hour rate in a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ricardo&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:06:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053804#M14463</guid>
      <dc:creator>camargos88</dc:creator>
      <dc:date>2020-04-28T14:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053821#M14465</link>
      <description>&lt;P&gt;If you create a relationship One to Many on department, you can use the Related function within your SUMX expression to get the desired results.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:12:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053821#M14465</guid>
      <dc:creator>Kogika</dc:creator>
      <dc:date>2020-04-28T14:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053867#M14466</link>
      <description>&lt;P&gt;Thanks for the quick responses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both tables are already related, but cannot solve it. I tried&amp;nbsp;&lt;EM&gt;&lt;SPAN&gt;HR = sumx(Departments;RELATED(&amp;nbsp; .....it will not propose any columns here)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have multiple entries for each department in table 2, for example 3 for Engineering department. Will the sumx not result in 3 time the hourly rate of that department?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:29:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053867#M14466</guid>
      <dc:creator>ITManuel</dc:creator>
      <dc:date>2020-04-28T14:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053871#M14467</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226359" data-lia-user-login="ITManuel" class="lia-mention lia-mention-user"&gt;ITManuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you provide some sample data ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ricardo&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1053871#M14467</guid>
      <dc:creator>camargos88</dc:creator>
      <dc:date>2020-04-28T14:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054046#M14474</link>
      <description>&lt;P&gt;Sorry I'm unable to upload files. How does it works?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:27:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054046#M14474</guid>
      <dc:creator>ITManuel</dc:creator>
      <dc:date>2020-04-28T15:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054072#M14477</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226359" data-lia-user-login="ITManuel" class="lia-mention lia-mention-user"&gt;ITManuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can paste the data here or upload the pbix using onedrive, googledrive, dropbox..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ricardo&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:38:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054072#M14477</guid>
      <dc:creator>camargos88</dc:creator>
      <dc:date>2020-04-28T15:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054079#M14478</link>
      <description>&lt;P&gt;Can't past it here for some reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a download link.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://we.tl/t-J8LOOh4gDv" target="_blank"&gt;https://we.tl/t-J8LOOh4gDv&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:42:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054079#M14478</guid>
      <dc:creator>ITManuel</dc:creator>
      <dc:date>2020-04-28T15:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054271#M14491</link>
      <description>&lt;LI-CODE lang="markup"&gt;// This is the simplest solution
// but it can be slow if HourLedger
// is big because RELATED is
// doing a context transition for
// each and every row it operates
// on.

// There's a relationship
// Department[Department] 1:* HourLedger[Department].
// One-way filtering from the dimension to
// the fact table.

[Amount] =
	SUMX(
		HourLedger,
		HourLedger[Hours] * RELATED( Department[HourlyRate] )
	)
	
// This one will be more performant

[Total Hours] = SUM( HourLedger[Hours] )

[Amount] =
	SUMX(
		Department,
		[Total Hours] * Department[HourlyRate]
	)
	
// Bear in mind, though, that the column Department in HourLedger
// should be hidden and no slicing by it should take
// place. All slicing is always done through dimensions,
// never directly on a fact table.&lt;/LI-CODE&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, 28 Apr 2020 17:20:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1054271#M14491</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-28T17:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUPVALUE the right DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1055634#M14545</link>
      <description>&lt;P&gt;Hi darlove,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;both ways working perfectly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much, great help.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 07:40:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUPVALUE-the-right-DAX/m-p/1055634#M14545</guid>
      <dc:creator>ITManuel</dc:creator>
      <dc:date>2020-04-29T07:40:46Z</dc:date>
    </item>
  </channel>
</rss>

