<?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: How to return a Tableobject using IF DAX-Function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212260#M52233</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337484" data-lia-user-login="v_rome" class="lia-mention lia-mention-user"&gt;v_rome&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;you cannot return the table using the IF Function. The best approach would be to calculate the start and end date based on your if condition and then in the return using these variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="direction: ltr; border-width: 100%;"&gt;
&lt;DIV style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 7.2416in;"&gt;
&lt;DIV style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 7.2416in;"&gt;
&lt;P style="margin: 0in; font-family: 'Segoe UI Emoji'; font-size: 10.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Follow us on &lt;/SPAN&gt;&lt;A href="https://www.linkedin.com/company/perytus/" target="_blank"&gt;&lt;SPAN style="font-weight: bold;"&gt;LinkedIn &lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 12.0pt; color: #e84c22;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 12.0pt; color: #e84c22;"&gt;&lt;A href="https://www.youtube.com/watch?v=l2MRTFReCX0" target="_blank"&gt;&lt;SPAN style="font-weight: bold;"&gt;Learn about conditional formatting at Microsoft Reactor&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri; font-size: 12.0pt;"&gt;My latest blog post &lt;/SPAN&gt;&lt;A href="https://perytus.com/2021/07/13/the-power-of-using-calculation-groups-with-inactive-relationships-part-1/" target="_blank"&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) &lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt;I would &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI Emoji'; font-size: 9.0pt;"&gt;❤&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri; font-size: 9.0pt;"&gt;Kudos&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt; if my solution helped. &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI Emoji'; font-size: 9.0pt;"&gt;&lt;span class="lia-unicode-emoji" title=":backhand_index_pointing_right:"&gt;👉&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt; If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation! &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-size: 9.0pt;"&gt;&lt;SPAN style="font-family: 'Segoe UI Emoji';"&gt;&lt;span class="lia-unicode-emoji" title=":high_voltage:"&gt;⚡&lt;/span&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri;"&gt;Visit us at &lt;/SPAN&gt;&lt;A href="https://perytus.com" target="_blank"&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri;"&gt;https://perytus.com&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri;"&gt;, your one-stop-shop for Power BI-related projects/training/consultancy.&lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; font-family: 'Segoe UI Emoji';"&gt;&lt;span class="lia-unicode-emoji" title=":high_voltage:"&gt;⚡&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 29 Nov 2021 15:30:12 GMT</pubDate>
    <dc:creator>parry2k</dc:creator>
    <dc:date>2021-11-29T15:30:12Z</dc:date>
    <item>
      <title>How to return a Tableobject using IF DAX-Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2211956#M52213</link>
      <description>&lt;P&gt;Hello I'm trying to get a Tableobject back from an IF-Function, to use it in a Slicer Visual.&lt;/P&gt;&lt;P&gt;I have created a DateTable with one Column of Dates. Now I want to get only specifiy Date Ranges based on my IF-Function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I'm going to provide only the DATESINPERIOD Function without IF it works, but I want to have a logic based on todays date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody say what I'm missing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get always this Error:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;The expression specified in the query is not a valid table expression.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance to the community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;img /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 12:10:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2211956#M52213</guid>
      <dc:creator>v_rome</dc:creator>
      <dc:date>2021-11-29T12:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a Tableobject using IF DAX-Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212257#M52232</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337484" data-lia-user-login="v_rome" class="lia-mention lia-mention-user"&gt;v_rome&lt;/a&gt; , I tried the same and got same error, seem like it is not allowing to return table using if &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt; , any thoughts on this.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 15:23:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212257#M52232</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-11-29T15:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a Tableobject using IF DAX-Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212260#M52233</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337484" data-lia-user-login="v_rome" class="lia-mention lia-mention-user"&gt;v_rome&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;you cannot return the table using the IF Function. The best approach would be to calculate the start and end date based on your if condition and then in the return using these variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="direction: ltr; border-width: 100%;"&gt;
&lt;DIV style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 7.2416in;"&gt;
&lt;DIV style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 7.2416in;"&gt;
&lt;P style="margin: 0in; font-family: 'Segoe UI Emoji'; font-size: 10.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Follow us on &lt;/SPAN&gt;&lt;A href="https://www.linkedin.com/company/perytus/" target="_blank"&gt;&lt;SPAN style="font-weight: bold;"&gt;LinkedIn &lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 12.0pt; color: #e84c22;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 12.0pt; color: #e84c22;"&gt;&lt;A href="https://www.youtube.com/watch?v=l2MRTFReCX0" target="_blank"&gt;&lt;SPAN style="font-weight: bold;"&gt;Learn about conditional formatting at Microsoft Reactor&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri; font-size: 12.0pt;"&gt;My latest blog post &lt;/SPAN&gt;&lt;A href="https://perytus.com/2021/07/13/the-power-of-using-calculation-groups-with-inactive-relationships-part-1/" target="_blank"&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) &lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt;I would &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI Emoji'; font-size: 9.0pt;"&gt;❤&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri; font-size: 9.0pt;"&gt;Kudos&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt; if my solution helped. &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI Emoji'; font-size: 9.0pt;"&gt;&lt;span class="lia-unicode-emoji" title=":backhand_index_pointing_right:"&gt;👉&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; font-size: 9.0pt;"&gt; If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation! &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-size: 9.0pt;"&gt;&lt;SPAN style="font-family: 'Segoe UI Emoji';"&gt;&lt;span class="lia-unicode-emoji" title=":high_voltage:"&gt;⚡&lt;/span&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri;"&gt;Visit us at &lt;/SPAN&gt;&lt;A href="https://perytus.com" target="_blank"&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri;"&gt;https://perytus.com&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-weight: bold; font-family: Calibri;"&gt;, your one-stop-shop for Power BI-related projects/training/consultancy.&lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; font-family: 'Segoe UI Emoji';"&gt;&lt;span class="lia-unicode-emoji" title=":high_voltage:"&gt;⚡&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 Nov 2021 15:30:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212260#M52233</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2021-11-29T15:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a Tableobject using IF DAX-Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212364#M52237</link>
      <description>&lt;P&gt;Yep. IF won't return tables, unfortunately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337484" data-lia-user-login="v_rome" class="lia-mention lia-mention-user"&gt;v_rome&lt;/a&gt;&amp;nbsp;Here's one way to work around that limitation for your specific case:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Check1 =
VAR lastDayOfMonth = EOMONTH ( TODAY (), 0 )
VAR shift = IF ( lastDayOfMonth - 7 &amp;lt;= TODAY (), 0, -1 )
VAR filter1 =
    DATESINPERIOD ( DateTable[Date], EOMONTH ( TODAY (), shift ), -1, YEAR )
RETURN
    filter1&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Nov 2021 16:38:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212364#M52237</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-11-29T16:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a Tableobject using IF DAX-Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212415#M52240</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337484" data-lia-user-login="v_rome" class="lia-mention lia-mention-user"&gt;v_rome&lt;/a&gt;&amp;nbsp;that's exactly what I recommended. Just in the future, please paste the code instead of pasting the images that way it is easy to provide the solution. Just my 2 cents.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 17:05:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-Tableobject-using-IF-DAX-Function/m-p/2212415#M52240</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2021-11-29T17:05:07Z</dc:date>
    </item>
  </channel>
</rss>

