<?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 Something like LOOKUP with conditions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Something-like-LOOKUP-with-conditions/m-p/783097#M4192</link>
    <description>&lt;P&gt;Hey there!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a little Problem that I'm not able to solve. I need something like a LOOKUP with checking conditions. Like if something is between to time borders.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here a little example:&lt;/P&gt;&lt;P&gt;I've got a first table with types and times. The table shows which type was produced during which time&amp;nbsp; period. So we have a start and an end.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Types&lt;/TD&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;TD&gt;End&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type 1&lt;/TD&gt;&lt;TD&gt;01-01-2019 07:00&lt;/TD&gt;&lt;TD&gt;01-02-2019 16:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type 2&lt;/TD&gt;&lt;TD&gt;01-02-2019 17:00&lt;/TD&gt;&lt;TD&gt;01-03-2019 08:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type 3&lt;/TD&gt;&lt;TD&gt;01-03-2019 09:00&lt;/TD&gt;&lt;TD&gt;01-04-2019 22:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a second table I've got events with a time stamp. Something like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Event&lt;/TD&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 1&lt;/TD&gt;&lt;TD&gt;01-01-2019 15:33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 2&lt;/TD&gt;&lt;TD&gt;01-03-2019 06:18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 3&lt;/TD&gt;&lt;TD&gt;01-03-2019 18:47&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is to combine these to tables. As an output I want the second table with the information which type was produced, when the event happend.&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Event&lt;/TD&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 1&lt;/TD&gt;&lt;TD&gt;01-01-2019 15:33&lt;/TD&gt;&lt;TD&gt;Type 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 2&lt;/TD&gt;&lt;TD&gt;01-03-2019 06:18&lt;/TD&gt;&lt;TD&gt;Type 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 3&lt;/TD&gt;&lt;TD&gt;01-03-2019 18:47&lt;/TD&gt;&lt;TD&gt;Type 3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've tried lookup and some if-conditions but always came to the same end: it doesn't work :(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So anybody here who can help me?&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2019 06:25:48 GMT</pubDate>
    <dc:creator>Gorgmaster</dc:creator>
    <dc:date>2019-09-04T06:25:48Z</dc:date>
    <item>
      <title>Something like LOOKUP with conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Something-like-LOOKUP-with-conditions/m-p/783097#M4192</link>
      <description>&lt;P&gt;Hey there!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a little Problem that I'm not able to solve. I need something like a LOOKUP with checking conditions. Like if something is between to time borders.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here a little example:&lt;/P&gt;&lt;P&gt;I've got a first table with types and times. The table shows which type was produced during which time&amp;nbsp; period. So we have a start and an end.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Types&lt;/TD&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;TD&gt;End&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type 1&lt;/TD&gt;&lt;TD&gt;01-01-2019 07:00&lt;/TD&gt;&lt;TD&gt;01-02-2019 16:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type 2&lt;/TD&gt;&lt;TD&gt;01-02-2019 17:00&lt;/TD&gt;&lt;TD&gt;01-03-2019 08:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type 3&lt;/TD&gt;&lt;TD&gt;01-03-2019 09:00&lt;/TD&gt;&lt;TD&gt;01-04-2019 22:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a second table I've got events with a time stamp. Something like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Event&lt;/TD&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 1&lt;/TD&gt;&lt;TD&gt;01-01-2019 15:33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 2&lt;/TD&gt;&lt;TD&gt;01-03-2019 06:18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 3&lt;/TD&gt;&lt;TD&gt;01-03-2019 18:47&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is to combine these to tables. As an output I want the second table with the information which type was produced, when the event happend.&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Event&lt;/TD&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 1&lt;/TD&gt;&lt;TD&gt;01-01-2019 15:33&lt;/TD&gt;&lt;TD&gt;Type 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 2&lt;/TD&gt;&lt;TD&gt;01-03-2019 06:18&lt;/TD&gt;&lt;TD&gt;Type 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Event 3&lt;/TD&gt;&lt;TD&gt;01-03-2019 18:47&lt;/TD&gt;&lt;TD&gt;Type 3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've tried lookup and some if-conditions but always came to the same end: it doesn't work :(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So anybody here who can help me?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 06:25:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Something-like-LOOKUP-with-conditions/m-p/783097#M4192</guid>
      <dc:creator>Gorgmaster</dc:creator>
      <dc:date>2019-09-04T06:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Something like LOOKUP with conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Something-like-LOOKUP-with-conditions/m-p/783487#M4205</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="167516" data-lia-user-login="Gorgmaster" class="lia-mention lia-mention-user"&gt;Gorgmaster&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a calculated&amp;nbsp;column in the second table you show:&lt;/P&gt;
&lt;PRE&gt;NewColType =
CALCULATE (
    DISTINCT ( Table1[Types] ),
    FILTER ( Table1, Table2[Time] &amp;gt;= Table1[Start] &amp;amp;&amp;amp; Table2[Time] &amp;lt; Table1[End] )
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when we get to the solution and consider kudoing if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 11:27:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Something-like-LOOKUP-with-conditions/m-p/783487#M4205</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-09-04T11:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Something like LOOKUP with conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Something-like-LOOKUP-with-conditions/m-p/783557#M4208</link>
      <description>&lt;P&gt;Thanks a lot! That was the solution I needed.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 12:47:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Something-like-LOOKUP-with-conditions/m-p/783557#M4208</guid>
      <dc:creator>Gorgmaster</dc:creator>
      <dc:date>2019-09-04T12:47:21Z</dc:date>
    </item>
  </channel>
</rss>

