<?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: Change Table Columns Based on Slicer Selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4772231#M182763</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="501067" data-lia-user-login="Sahir_Maharaj" class="lia-mention lia-mention-user"&gt;Sahir_Maharaj&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I tried but measure giving the following error.&lt;BR /&gt;&lt;SPAN&gt;The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jul 2025 12:08:49 GMT</pubDate>
    <dc:creator>sharmil_28</dc:creator>
    <dc:date>2025-07-22T12:08:49Z</dc:date>
    <item>
      <title>Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3108600#M109705</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a way to switch out columns in a table if a selection from a slicer is made.&lt;/P&gt;&lt;P&gt;Example&lt;BR /&gt;Year Slicer = 2021, show Columns A, B and C in my table or if&lt;BR /&gt;Year Slicer = 2022, show Columns A, B, D, G or if&lt;/P&gt;&lt;P&gt;Year Slicer = 2023, show Columns A, D, E, etc,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone found a way to do this while trying to use the same table and not have to resort to bookmarks using stacked tables?&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 18:53:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3108600#M109705</guid>
      <dc:creator>stsmith67</dc:creator>
      <dc:date>2023-03-02T18:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3111894#M109969</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495432" data-lia-user-login="stsmith67" class="lia-mention lia-mention-user"&gt;stsmith67&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can achieve this using the "Switch" function in DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Selected Columns = 
SWITCH (
    SELECTEDVALUE ( 'Year'[Year] ),
    2021, SELECTCOLUMNS ( Table, "A", [A], "B", [B], "C", [C] ),
    2022, SELECTCOLUMNS ( Table, "A", [A], "B", [B], "D", [D], "G", [G] ),
    2023, SELECTCOLUMNS ( Table, "A", [A], "D", [D], "E", [E] ),
    BLANK()
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 04 Mar 2023 22:07:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3111894#M109969</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-03-04T22:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3111896#M109970</link>
      <description>&lt;P&gt;The "Switch" function checks the selected value of the slicer and returns the appropriate set of columns using the "SelectColumns" function. If no value is selected in the slicer, the formula returns BLANK().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can then use the "Selected Columns" measure in your table visualization instead of selecting the columns directly. When you change the value in the slicer, the columns displayed in the table will update automatically based on the selected year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you might need further guidance.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2023 22:08:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3111896#M109970</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-03-04T22:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3113847#M110161</link>
      <description>&lt;P&gt;I tried that and it looked like it was going to work, but then I get this error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 13:03:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3113847#M110161</guid>
      <dc:creator>stsmith67</dc:creator>
      <dc:date>2023-03-06T13:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3166626#M113907</link>
      <description>&lt;P&gt;Is there a way to change within the select statement? For example, select if 1=1 then column A vs B , column 2, if x=y then C vs D, column 4???&amp;nbsp;&amp;nbsp;&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;&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>Fri, 31 Mar 2023 22:45:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3166626#M113907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-31T22:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3179956#M114928</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also am trying to do this and got the same error as above about the multiple values not being converted to scalar value. Your response explained how it works but didn't really answer why this error would occur. Do you know why we would be getting this error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 13:51:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3179956#M114928</guid>
      <dc:creator>elaine1217</dc:creator>
      <dc:date>2023-04-10T13:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3765588#M146962</link>
      <description>&lt;P&gt;Try this one&amp;nbsp;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=CHGmuzxu_BE" target="_blank"&gt;https://www.youtube.com/watch?v=CHGmuzxu_BE&lt;/A&gt;&amp;nbsp;(in the description there is a link to 1st video that might be needed to continue with this one)&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 08:31:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/3765588#M146962</guid>
      <dc:creator>Sultanista</dc:creator>
      <dc:date>2024-03-15T08:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4772231#M182763</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="501067" data-lia-user-login="Sahir_Maharaj" class="lia-mention lia-mention-user"&gt;Sahir_Maharaj&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I tried but measure giving the following error.&lt;BR /&gt;&lt;SPAN&gt;The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2025 12:08:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4772231#M182763</guid>
      <dc:creator>sharmil_28</dc:creator>
      <dc:date>2025-07-22T12:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4775042#M182869</link>
      <description>&lt;P&gt;I understand there is no straight forward way to do this. I was able to achieve this without having to use bookmarks.&lt;/P&gt;&lt;P&gt;Here’s how I solved this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Unpivot your columns (A, B, C, etc.) in Power Query to get a “long” format&lt;/LI&gt;&lt;LI&gt;Create a mapping table that specifies which columns (attributes) appear for each year, for example:&lt;/LI&gt;&lt;LI&gt;Create a YearSelection slicer table (distinct years).&lt;/LI&gt;&lt;LI&gt;Set up relationships so filtering flows like this:&lt;UL&gt;&lt;LI&gt;YearSelection → YearColumnMapping → Columns Lookup → Fact Table&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Build your matrix visual with:&lt;UL&gt;&lt;LI&gt;Rows: USER&lt;/LI&gt;&lt;LI&gt;Columns: Attribute&lt;/LI&gt;&lt;LI&gt;Values: Value&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;When you select a year, only the corresponding columns appear in the matrix.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This method is fully dynamic, scalable, and avoids bookmarks or multiple stacked tables.&lt;/P&gt;&lt;P&gt;I have the PBIX of the model and visual so you can see exactly how the relationships and slicer interact but not able to attach it here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 11:45:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4775042#M182869</guid>
      <dc:creator>MohamedFowzan1</dc:creator>
      <dc:date>2025-07-24T11:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4776842#M182958</link>
      <description>&lt;P&gt;Hello, has this been resolved?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 20:07:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4776842#M182958</guid>
      <dc:creator>MoonlightDaddy</dc:creator>
      <dc:date>2025-07-25T20:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4776845#M182959</link>
      <description>&lt;P&gt;Hello, could you please elaborate the below part in your solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;YearColumnMapping → Columns Lookup → Fact Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What's the steps in 'Columns Lookup againt Fact Table'? Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 20:09:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4776845#M182959</guid>
      <dc:creator>MoonlightDaddy</dc:creator>
      <dc:date>2025-07-25T20:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4776921#M182962</link>
      <description>&lt;P&gt;Posting screenshots of Paramters, dataset and DAX for better understanding:&lt;BR /&gt;Ref 1:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Ref2:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Ref3:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Ref4:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Ref5:&lt;BR /&gt;&lt;/SPAN&gt;Actual table:&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;Ref6:&lt;BR /&gt;Unpivot table:&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Ref7:&lt;BR /&gt;Relationships:&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;This would be a starting point for you to play around with actual data and build on it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 26 Jul 2025 01:35:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4776921#M182962</guid>
      <dc:creator>MohamedFowzan1</dc:creator>
      <dc:date>2025-07-26T01:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change Table Columns Based on Slicer Selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4777328#M182975</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495432" data-lia-user-login="stsmith67" class="lia-mention lia-mention-user"&gt;stsmith67&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="606457" data-lia-user-login="MoonlightDaddy" class="lia-mention lia-mention-user"&gt;MoonlightDaddy&lt;/a&gt;&amp;nbsp;Did the screenshots and explanation solve the issue?&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jul 2025 04:49:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-Table-Columns-Based-on-Slicer-Selection/m-p/4777328#M182975</guid>
      <dc:creator>MohamedFowzan1</dc:creator>
      <dc:date>2025-07-27T04:49:46Z</dc:date>
    </item>
  </channel>
</rss>

