<?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 Return table with condition function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/2026590#M45331</link>
    <description>&lt;P&gt;DAX conditional functions such as IF SWITCH RETURNS scalar value.&lt;/P&gt;&lt;P&gt;I am converting SSRS reports to Paginated Report and publishing in powerBI Report Server(PBIRS) using PowerBI Dataset. I am passing two parameters not tie to dataset table. example from dax studio.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. first parameter has the list and 2. parameter has the lanlogin.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if lanlogin is found in the list different table values needed to be return otherwise another table values needed to be return. Like below, since limitation of IF SWITCH conditional DAX function I couldn't achieve what I was looking for example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DEFINE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; _SecurityList = &lt;SPAN&gt;row&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"HasAccess"&lt;/SPAN&gt;,&lt;SPAN&gt;@HasAccess&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; _IsMGR = &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;_SecurityList, &lt;SPAN&gt;search&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;LEFT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RIGHT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;@LanLogin&lt;/SPAN&gt;,&lt;SPAN&gt;len&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;@LanLogin&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;-&lt;SPAN&gt;9&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;,&lt;SPAN&gt;len&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;@LanLogin&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;-&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;,&lt;SPAN&gt;[HasAccess]&lt;/SPAN&gt;,&lt;SPAN&gt;1&lt;/SPAN&gt;,&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &amp;gt;= &lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;,&lt;SPAN&gt;"0"&lt;/SPAN&gt;,&lt;SPAN&gt;"1"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(ROW("fullAccess",_IsMGR)="1", table1, table2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where table1 and table2 are from dataset and can be manipulated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is there some idea&amp;nbsp; if this can be achievable in DAX so that I can return table or at least 1 columns with multiple rows using combination of table return functions and conditional functions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 17:06:38 GMT</pubDate>
    <dc:creator>rxt</dc:creator>
    <dc:date>2021-08-19T17:06:38Z</dc:date>
    <item>
      <title>Return table with condition function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/2026590#M45331</link>
      <description>&lt;P&gt;DAX conditional functions such as IF SWITCH RETURNS scalar value.&lt;/P&gt;&lt;P&gt;I am converting SSRS reports to Paginated Report and publishing in powerBI Report Server(PBIRS) using PowerBI Dataset. I am passing two parameters not tie to dataset table. example from dax studio.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. first parameter has the list and 2. parameter has the lanlogin.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if lanlogin is found in the list different table values needed to be return otherwise another table values needed to be return. Like below, since limitation of IF SWITCH conditional DAX function I couldn't achieve what I was looking for example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DEFINE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; _SecurityList = &lt;SPAN&gt;row&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"HasAccess"&lt;/SPAN&gt;,&lt;SPAN&gt;@HasAccess&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; _IsMGR = &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/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t;P&gt;&lt;SPAN&gt;is there some idea&amp;nbsp; if this can be achievable in DAX so that I can return table or at least 1 columns with multiple rows using combination of table return functions and conditional functions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 17:06:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/2026590#M45331</guid>
      <dc:creator>rxt</dc:creator>
      <dc:date>2021-08-19T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Return table with condition function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/2026639#M45332</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223440" data-lia-user-login="rxt" class="lia-mention lia-mention-user"&gt;rxt&lt;/a&gt;&amp;nbsp;If they have the same number of columns you could do this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = 
    VAR __table1 = 'Table5'
    VAR __table2 = 'Table6'
    VAR __truefalse = IF(TRUE(),1,2)
    VAR __table1a = ADDCOLUMNS(__table1,"truefalse",__truefalse)
    VAR __table2a = ADDCOLUMNS(__table2,"truefalse",__truefalse)
    VAR __table1b = EXCEPT(__table1a,FILTER(__table1a,[truefalse]=1))
    VAR __table2b = EXCEPT(__table2a,FILTER(__table2a,[truefalse]=2))
RETURN
    UNION(__table1b, __table2b)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Aug 2021 17:42:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/2026639#M45332</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-19T17:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Return table with condition function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/2027352#M45358</link>
      <description>&lt;P&gt;Many thanks Greg, that did the trick to me. Appriciated your Assistance&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 05:16:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/2027352#M45358</guid>
      <dc:creator>rxt</dc:creator>
      <dc:date>2021-08-20T05:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Return table with condition function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/3214467#M117337</link>
      <description>&lt;P&gt;You appear to have marked your response to the answer as the accepted answer. I don't know if it's too late, but you should mark his answer as the solution so that he gets credit for it.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 22:23:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-with-condition-function/m-p/3214467#M117337</guid>
      <dc:creator>CElzinga</dc:creator>
      <dc:date>2023-05-01T22:23:21Z</dc:date>
    </item>
  </channel>
</rss>

