<?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: Creating dynamic table with SELECTEDVALUE? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3802550#M148673</link>
    <description>&lt;P&gt;Thank you for the answer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I wanted to know how I can update the solution to a measure if I want to find out whether a specific product was present in the month of April but not in the month of March. A product is present if it has a corresponding row for it in that month.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I wrote something which works for table (but doesn't work dynamically for any month because of the limitation on SELECTEDVALUE)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Added =

var table1 = CALCULATETABLE(SUMMARIZE('Data', 'Data'[Product]), 'Data'[Month] = 4)
var table2 = CALCULATETABLE(SUMMARIZE('Data', 'Data'[Product]), 'Data'[Month] = 3)

RETURN
EXCEPT(table1, table2)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;How to modify this into a measure using SELECTEDVALUE and CALCULATE?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2024 14:38:16 GMT</pubDate>
    <dc:creator>afaro</dc:creator>
    <dc:date>2024-04-01T14:38:16Z</dc:date>
    <item>
      <title>Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3799701#M148534</link>
      <description>&lt;P&gt;Is it possible to create dynamic tables this way?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written dax for creating tablewhich works perfectly fine when I manually provide the filters (which then makes it a static table) but when I try to filter the data and create table using value obtained from SELECTEDVALUE then it just returns me an empty table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, can SELECTEDVALUE be used to create dynamic tables?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 21:58:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3799701#M148534</guid>
      <dc:creator>afaro</dc:creator>
      <dc:date>2024-03-29T21:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3799703#M148535</link>
      <description>&lt;P&gt;SELECTEDVALUE is meaningless without a filter context. You can create "dynamic tables"&amp;nbsp; but only as an intermediate step in a measure calculation.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 22:00:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3799703#M148535</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-29T22:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3801682#M148644</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp; Thanks for your contribution on this thread.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="687567" data-lia-user-login="afaro" class="lia-mention lia-mention-user"&gt;afaro&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;have provided a explanation&amp;nbsp;for your problem.&amp;nbsp;To further elaborate on @lbendlin’s explanation, I would like to add that if you are creating a calculated table, the values within it will remain static and will not be influenced by user interactions such as filters or slicers. This is an important aspect to consider when working with Power BI.&lt;/P&gt;
&lt;P&gt;As suggested by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;, a potential solution could be to create a &lt;STRONG&gt;measure&lt;/STRONG&gt;. This measure can then be applied to a table visual along with other relevant fields. This approach will allow the data to be displayed dynamically, adapting to user interactions.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _seltype =
    SELECTEDVALUE ( 'Table1'[slicerfield] )
RETURN
    CALCULATE (
        SUM ( 'Table2'[value] ),
        FILTER ( 'Table2', 'Table2'[type] = _seltype )
    )&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 08:49:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3801682#M148644</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-01T08:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3802550#M148673</link>
      <description>&lt;P&gt;Thank you for the answer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I wanted to know how I can update the solution to a measure if I want to find out whether a specific product was present in the month of April but not in the month of March. A product is present if it has a corresponding row for it in that month.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I wrote something which works for table (but doesn't work dynamically for any month because of the limitation on SELECTEDVALUE)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Added =

var table1 = CALCULATETABLE(SUMMARIZE('Data', 'Data'[Product]), 'Data'[Month] = 4)
var table2 = CALCULATETABLE(SUMMARIZE('Data', 'Data'[Product]), 'Data'[Month] = 3)

RETURN
EXCEPT(table1, table2)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;How to modify this into a measure using SELECTEDVALUE and CALCULATE?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 14:38:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3802550#M148673</guid>
      <dc:creator>afaro</dc:creator>
      <dc:date>2024-04-01T14:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3802913#M148683</link>
      <description>&lt;P&gt;Measures can only return scalar values. So it would have to be something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RETURN
COUNTROWS(EXCEPT(table1, table2))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Apr 2024 19:11:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3802913#M148683</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-01T19:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3803727#M148729</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="687567" data-lia-user-login="afaro" class="lia-mention lia-mention-user"&gt;afaro&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(see&lt;STRONG&gt; the attachment&lt;/STRONG&gt;), please check if that is what you want.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Added products = 
VAR _month =
    SELECTEDVALUE ( 'Date'[Month] )
VAR table1 =
    CALCULATETABLE (
        VALUES ( 'Data'[Product] ),
        FILTER ( 'Data', 'Data'[Month] = _month )
    )
VAR table2 =
    CALCULATETABLE (
        VALUES ( 'Data'[Product] ),
        FILTER ( 'Data', 'Data'[Month] = _month - 1 )
    )
VAR _tab =
    EXCEPT ( table1, table2 )
RETURN
    CONCATENATEX ( _tab, [Product], "," )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 05:42:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3803727#M148729</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-02T05:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3805413#M148791</link>
      <description>&lt;P&gt;I wanted to see this in a tabular format. Is that possible?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 16:00:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3805413#M148791</guid>
      <dc:creator>afaro</dc:creator>
      <dc:date>2024-04-02T16:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dynamic table with SELECTEDVALUE?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3805542#M148797</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Measures can only return scalar values.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 17:10:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-dynamic-table-with-SELECTEDVALUE/m-p/3805542#M148797</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-02T17:10:43Z</dc:date>
    </item>
  </channel>
</rss>

