<?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: Conditional relationship for multiple tables in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1650344#M17993</link>
    <description>&lt;P&gt;Well, I think you could do it in DAX by creating a calculated column in the connected users table something like:&lt;BR /&gt;&lt;BR /&gt;IF(ISBLANK( [Facility_Code]) ,[System_Code], [Facility_Code] ) &lt;BR /&gt;&lt;BR /&gt;and then create your relationship on that column. But personally I would typically try and do row level calculations like this in PowerQuery or a source view if I can. It's not such a big deal on most tables if you are only dealing with a few million rows or less. See here&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/" target="_blank"&gt;https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/&lt;/A&gt; for a discussion of the pro/cons of the two approaches and why it often does not matter.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Feb 2021 23:16:02 GMT</pubDate>
    <dc:creator>d_gosbell</dc:creator>
    <dc:date>2021-02-07T23:16:02Z</dc:date>
    <item>
      <title>Conditional relationship for multiple tables</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1644167#M17925</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 4 tables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;logins, ConnectedUsers,FacilityCode, ProviderCode.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically in ConnectedUsers table i have:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Provider_Name&lt;/TD&gt;&lt;TD&gt;System_Code&lt;/TD&gt;&lt;TD&gt;Facility_Code&lt;/TD&gt;&lt;TD&gt;RegisteredUsers&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AHSE&lt;/TD&gt;&lt;TD&gt;GAYA&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCMS&lt;/TD&gt;&lt;TD&gt;GAYA&lt;/TD&gt;&lt;TD&gt;AA02&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AHSE&lt;/TD&gt;&lt;TD&gt;GAYA&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;logins&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;EventID&lt;/TD&gt;&lt;TD&gt;System_Code&lt;/TD&gt;&lt;TD&gt;Facility_Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01&lt;/TD&gt;&lt;TD&gt;GAYA&lt;/TD&gt;&lt;TD&gt;AA02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02&lt;/TD&gt;&lt;TD&gt;GAYA&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 a measure that calculates logins based on event ID (count), however, I want the system to check if facility code in connectedusers table is blank then it should take system_code&amp;nbsp; registered users.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 08:57:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1644167#M17925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-04T08:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional relationship for multiple tables</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1646057#M17940</link>
      <description>&lt;P&gt;You can't do that in DAX but you can merge tables in PowerQuery based on fuzzy logic like yours. Look at the custom Column Generator function in Table.AddColumn() .&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 18:27:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1646057#M17940</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-02-04T18:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional relationship for multiple tables</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1650344#M17993</link>
      <description>&lt;P&gt;Well, I think you could do it in DAX by creating a calculated column in the connected users table something like:&lt;BR /&gt;&lt;BR /&gt;IF(ISBLANK( [Facility_Code]) ,[System_Code], [Facility_Code] ) &lt;BR /&gt;&lt;BR /&gt;and then create your relationship on that column. But personally I would typically try and do row level calculations like this in PowerQuery or a source view if I can. It's not such a big deal on most tables if you are only dealing with a few million rows or less. See here&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/" target="_blank"&gt;https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/&lt;/A&gt; for a discussion of the pro/cons of the two approaches and why it often does not matter.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 23:16:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1650344#M17993</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2021-02-07T23:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional relationship for multiple tables</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1650635#M18001</link>
      <description>&lt;P&gt;If you want to be cute you can rewrite&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;IF(ISBLANK( [Facility_Code]) ,[System_Code], [Facility_Code] )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;COALESCE ( [Facility_Code]) ,[System_Code] )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but I'm not sure it would make any difference in performance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 03:36:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1650635#M18001</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-02-08T03:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional relationship for multiple tables</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1651040#M18012</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;but I'm not sure it would make any difference in performance.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, they are identical in terms of performance producing identical query plans. COALESCE is just syntactic sugar over the IF( ISBLANK() ...) format&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 08:00:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Conditional-relationship-for-multiple-tables/m-p/1651040#M18012</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2021-02-08T08:00:43Z</dc:date>
    </item>
  </channel>
</rss>

