<?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 2 Tables and if(and logic in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/762965#M3271</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a bit stuck right now. I'm sure there's an easy solution, but it's evading me right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to connect two tables with a relationship on customerid. I want to basically create a filter using this column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Test = if(and(SALs[CPTCode]="NOBIL", SALs[DateOfService]=&lt;FONT color="#FF0000"&gt;Appointment[AppointmentDate],&lt;FONT color="#000000"&gt; 1, 0)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It seems I can't connect these two tables. It should be a 1:1 match on the dates. Am I using the wrong function?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 09 Aug 2019 14:26:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-09T14:26:20Z</dc:date>
    <item>
      <title>2 Tables and if(and logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/762965#M3271</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a bit stuck right now. I'm sure there's an easy solution, but it's evading me right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to connect two tables with a relationship on customerid. I want to basically create a filter using this column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Test = if(and(SALs[CPTCode]="NOBIL", SALs[DateOfService]=&lt;FONT color="#FF0000"&gt;Appointment[AppointmentDate],&lt;FONT color="#000000"&gt; 1, 0)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It seems I can't connect these two tables. It should be a 1:1 match on the dates. Am I using the wrong function?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Aug 2019 14:26:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/762965#M3271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-09T14:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Tables and if(and logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/763254#M3282</link>
      <description>Your explanation is about as clear as mud...&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Fri, 09 Aug 2019 22:21:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/763254#M3282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-09T22:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Tables and if(and logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/765235#M3396</link>
      <description>&lt;P&gt;Sorry, that was really a messy explaination. For further clarification, I have the following 3 tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ClientTable&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CustomerID&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Primary Staff&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Jack&lt;/TD&gt;&lt;TD&gt;Adam&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;Alex&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Joan&lt;/TD&gt;&lt;TD&gt;Adam&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Jill&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appointment Table&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&l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/TD&gt;&lt;TD&gt;SALStaff&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2/1/2019&lt;/TD&gt;&lt;TD&gt;NOBIL&lt;/TD&gt;&lt;TD&gt;Aubree&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1/1/2019&lt;/TD&gt;&lt;TD&gt;NOBIL&lt;/TD&gt;&lt;TD&gt;Aubree&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2/1/2019&lt;/TD&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;Aubree&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to make sure that all views of tables are related. So when I click on the 2nd row in the Sals table, the only option that shows up in the client table is Joan and the 4th row on the appointment table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, when I click on the second row in the SALs table, nothing is dynamically filtered on the client table. My relationships are currently all based on ClientID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 12:24:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/765235#M3396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-13T12:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Tables and if(and logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/765309#M3404</link>
      <description>For the time being you cannot have it the way you want without creating certain measures. This is because you want to filter tables based on not only CustomerID but also on dates and in PBI you cannot create relationships based on 2 columns in each table, only one can be used.&lt;BR /&gt;&lt;BR /&gt;If you follow the star schema, then you should have at least 4 tables: the three you've shown and one proper Date table.&lt;BR /&gt;&lt;BR /&gt;'Clients'[CustomerID] 1:* Appointments[CustomerID]&lt;BR /&gt;Clients[CustomerID] 1:* SALs[CustomerID]&lt;BR /&gt;Dates[Date] 1:* Appointments[AppointmentDate]&lt;BR /&gt;Dates[Date] 1:* SALs[DateOfService]&lt;BR /&gt;&lt;BR /&gt;This is the right setup. If you now slice by customers in the Clients table and dates in the Dates table (the linked fields in fact tables should be hidden from the user), you'll get the right rows in both fact tables if you display them in a table.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Tue, 13 Aug 2019 13:15:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-Tables-and-if-and-logic/m-p/765309#M3404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-13T13:15:22Z</dc:date>
    </item>
  </channel>
</rss>

