<?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 Report Builder DA Query builder OR query across 2 columns in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Report-Builder-DA-Query-builder-OR-query-across-2-columns/m-p/4024959#M35798</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a Paginated report in report builder (not desktop) which has 2 Account fields, AccountName and AccountParent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a parameter related to each and want people to be able to search on either.&amp;nbsp; So the query would look like:&amp;nbsp; [AccountName] = parameter1.value&amp;nbsp; OR&amp;nbsp; [AccountParent] = parameter2.value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help with the syntax here, I've been scratching my head for a few hours.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 10:49:37 GMT</pubDate>
    <dc:creator>daveedd</dc:creator>
    <dc:date>2024-07-04T10:49:37Z</dc:date>
    <item>
      <title>Report Builder DA Query builder OR query across 2 columns</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Report-Builder-DA-Query-builder-OR-query-across-2-columns/m-p/4024959#M35798</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a Paginated report in report builder (not desktop) which has 2 Account fields, AccountName and AccountParent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a parameter related to each and want people to be able to search on either.&amp;nbsp; So the query would look like:&amp;nbsp; [AccountName] = parameter1.value&amp;nbsp; OR&amp;nbsp; [AccountParent] = parameter2.value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help with the syntax here, I've been scratching my head for a few hours.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 10:49:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Report-Builder-DA-Query-builder-OR-query-across-2-columns/m-p/4024959#M35798</guid>
      <dc:creator>daveedd</dc:creator>
      <dc:date>2024-07-04T10:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Report Builder DA Query builder OR query across 2 columns</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Report-Builder-DA-Query-builder-OR-query-across-2-columns/m-p/4025808#M35803</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="367241" data-lia-user-login="daveedd" class="lia-mention lia-mention-user"&gt;daveedd&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create paged reports in Report Builder to filter data based on or AccountName, AccountParent You can define parameters and then build queries to use those parameters with OR conditions.&lt;/P&gt;&lt;P&gt;Step 1: Define the parameters&lt;/P&gt;&lt;P&gt;Open your report in the Report Builder. In the Report Data pane, right-click Parameters and select Add Parameter twice to create two parameters:&lt;BR /&gt;Parameter 1: For AccountName&lt;BR /&gt;Parameter 2: For AccountParent&lt;/P&gt;&lt;P&gt;Configuration parameters:&lt;BR /&gt;Parameter 1:&lt;BR /&gt;Name: AccountName&lt;BR /&gt;Data type: text&lt;BR /&gt;Hint: Enter the account name&lt;BR /&gt;Parameter 2:&lt;BR /&gt;Name: AccountParent&lt;BR /&gt;Data type: text&lt;BR /&gt;Hint: Enter the parent account&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Report Data pane, right-click the dataset and select Dataset Properties.&lt;BR /&gt;In the Query section, modify the SQL query to use parameters with OR conditions. The following is an example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT *
FROM YourTableName
WHERE (@AccountName IS NULL OR AccountName = @AccountName)
   OR (@AccountParent IS NULL OR AccountParent = @AccountParent)&lt;/LI-CODE&gt;&lt;P&gt;This query uses the parameters @AccountName and @AccountParent. it checks if each parameter is NULL (i.e., not specified by the user) and includes the condition if it is.&lt;BR /&gt;Go to the Parameters tab in the Dataset Properties window and make sure that the parameters correctly map @AccountName to @AccountParent to the report parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hackcrr&lt;/P&gt;&lt;P&gt;If this post helps, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;kudos to this post&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 23:57:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Report-Builder-DA-Query-builder-OR-query-across-2-columns/m-p/4025808#M35803</guid>
      <dc:creator>hackcrr</dc:creator>
      <dc:date>2024-07-04T23:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Report Builder DA Query builder OR query across 2 columns</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Report-Builder-DA-Query-builder-OR-query-across-2-columns/m-p/4030364#M35854</link>
      <description>&lt;P&gt;Thanks for the response.&amp;nbsp; I have the parameters set up, but still struggling with the query.&amp;nbsp; I'm connecting to a Power BI semantic model so having to use DAX rather than SQL&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 13:28:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Report-Builder-DA-Query-builder-OR-query-across-2-columns/m-p/4030364#M35854</guid>
      <dc:creator>daveedd</dc:creator>
      <dc:date>2024-07-08T13:28:54Z</dc:date>
    </item>
  </channel>
</rss>

