<?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: Custom slicer to select and display multiple columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4036058#M159952</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to unpivot all columns but customer so those column names go to the rows and then split or extract the year and category (ABC) from the unpivoted columns. Your data should something like below after the transformation:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please see attached pbix for your reference.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2024 04:21:27 GMT</pubDate>
    <dc:creator>danextian</dc:creator>
    <dc:date>2024-07-11T04:21:27Z</dc:date>
    <item>
      <title>Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4035967#M159949</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a custom slicer based on multiple columns. Here is the data I have currently:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;aa&lt;/TD&gt;&lt;TD&gt;bb&lt;/TD&gt;&lt;TD&gt;cc&lt;/TD&gt;&lt;TD&gt;dd&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020 A&lt;/TD&gt;&lt;TD&gt;2020 B&lt;/TD&gt;&lt;TD&gt;2020 C&lt;/TD&gt;&lt;TD&gt;2021 A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;TD&gt;c3&lt;/TD&gt;&lt;TD&gt;d3&lt;/TD&gt;&lt;TD&gt;Customer 3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a slicer such that I can select one or multiple specific years. For example, if I select "2020" in the slicer, the output would look like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;aa&lt;/TD&gt;&lt;TD&gt;bb&lt;/TD&gt;&lt;TD&gt;cc&lt;/TD&gt;&lt;TD&gt;dd&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020 A&lt;/TD&gt;&lt;TD&gt;2020 B&lt;/TD&gt;&lt;TD&gt;2020 C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a1&lt;/TD&gt;&lt;TD&gt;b1&lt;/TD&gt;&lt;TD&gt;c1&lt;/TD&gt;&lt;TD&gt;d1&lt;/TD&gt;&lt;TD&gt;Customer 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a2&lt;/TD&gt;&lt;TD&gt;b2&lt;/TD&gt;&lt;TD&gt;c2&lt;/TD&gt;&lt;TD&gt;d2&lt;/TD&gt;&lt;TD&gt;Customer 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a3&lt;/TD&gt;&lt;TD&gt;b3&lt;/TD&gt;&lt;TD&gt;c3&lt;/TD&gt;&lt;TD&gt;d3&lt;/TD&gt;&lt;TD&gt;Customer 3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate your help - thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 18:17:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4035967#M159949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-15T18:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4036058#M159952</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to unpivot all columns but customer so those column names go to the rows and then split or extract the year and category (ABC) from the unpivoted columns. Your data should something like below after the transformation:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please see attached pbix for your reference.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 04:21:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4036058#M159952</guid>
      <dc:creator>danextian</dc:creator>
      <dc:date>2024-07-11T04:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4037373#M160041</link>
      <description>&lt;P&gt;Thank you for your reply. I actually have more columns in addition to the Customer column that I would like to preserve (see below). Does the aforementioned method also work? I'm worried that it might be too messy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;aa&lt;/TD&gt;&lt;TD&gt;bb&lt;/TD&gt;&lt;TD&gt;Customer&lt;/TD&gt;&lt;TD&gt;dd&lt;/TD&gt;&lt;TD&gt;ee&lt;/TD&gt;&lt;TD&gt;2020 A&lt;/TD&gt;&lt;TD&gt;2020 B&lt;/TD&gt;&lt;TD&gt;2020 C&lt;/TD&gt;&lt;TD&gt;2021 A&lt;/TD&gt;&lt;TD&gt;2021 B...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a1&lt;/TD&gt;&lt;TD&gt;b1&lt;/TD&gt;&lt;TD&gt;Customer 1&lt;/TD&gt;&lt;TD&gt;d1&lt;/TD&gt;&lt;TD&gt;e1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a2&lt;/TD&gt;&lt;TD&gt;b2&lt;/TD&gt;&lt;TD&gt;Customer 2&lt;/TD&gt;&lt;TD&gt;d2&lt;/TD&gt;&lt;TD&gt;e2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a3&lt;/TD&gt;&lt;TD&gt;b3&lt;/TD&gt;&lt;TD&gt;Customer 3&lt;/TD&gt;&lt;TD&gt;d3&lt;/TD&gt;&lt;TD&gt;e3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate your help - thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 14:44:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4037373#M160041</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-11T14:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4042086#M160290</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="15697" data-lia-user-login="danextian" class="lia-mention lia-mention-user"&gt;danextian&lt;/a&gt; Thanks for your contribution on this thread.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;Anonymous&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="15697" data-lia-user-login="danextian" class="lia-mention lia-mention-user"&gt;danextian&lt;/a&gt;&amp;nbsp;has provided the possible solution, here need to make a little adjustment: select the columns which include year info and only unpivot these selected columns in Power Query Editor. Please find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;1. Only unpivot the columns which include year info&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;= Table.Unpivot(#"Changed Type", {"2020 A", "2020 B", "2020 C", "2021 A", "2021 B", "2021 C"}, "Attribute", "Value")&lt;/LI-CODE&gt;
&lt;P&gt;2. Create a Text filter and matrix visual with below settings&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 08:54:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4042086#M160290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-15T08:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4042746#M160336</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your reply. I am experimenting with the method you just provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Due to user demand, the output visual has to be a &lt;STRONG&gt;table&lt;/STRONG&gt;, instead of a matrix, which is why I expanded the columns as 2020A, 2020B, 2020C... earlier, instead of unpivoting them into a single Attribute column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you kindly help with this situation? Is there any way to overcome this roadblock? How could I modify your method to create a table output? Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 14:42:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4042746#M160336</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-15T14:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4044056#M160401</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If you can't unpivot these columns with the year inside the power query editor then they are multiple columns and not one. I have updated my pbix file(see&lt;EM&gt;&lt;STRONG&gt; the attachment&lt;/STRONG&gt;&lt;/EM&gt;), please check if it is what you want.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 09:46:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4044056#M160401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-16T09:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4044413#M160416</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your response. This is working great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I have encountered 1 problem and 2 follow-up questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The visual works perfect when I select a single year in the slicer, but it would not work when I &lt;STRONG&gt;multi-select&lt;/STRONG&gt;. It could not display ALL years as well. For my data, I have 4 years that I would like to either display 1, multiple, or all years. Could you kindly help on this topic?&lt;/LI&gt;&lt;LI&gt;Currently, when I select 2020 in the Year slicer, columns 2021 A, B, and C would be blank but still displayed. Is it possible to &lt;STRONG&gt;hide&lt;/STRONG&gt; and not display the columns that weren't selected in the Year slicer?&lt;/LI&gt;&lt;LI&gt;The table visual you created has columns aa, bb, cc... selected from "Table 2", and 2020A, 2020B, 2020C... selected from the "Year" table. Because I plan to refresh the Power BI dashboard weekly with new data pasted to the same excel file, is it possible to select 2020A, 2020B, 2020C... from "Table 2" instead of "Year"? How can I modify the current code for the slicer to still work?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. Really appreciate your help!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 14:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4044413#M160416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-16T14:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4053499#M160855</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I updated my pbix file(see&lt;EM&gt;&lt;STRONG&gt; the attachment&lt;/STRONG&gt;&lt;/EM&gt;), please find the details in it.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The below one is my answer of your above questions:&lt;/P&gt;
&lt;P&gt;1. It has been achieved in my updated pbix file.&lt;/P&gt;
&lt;P&gt;2 and 3: I'm sorry those two things can't be accomplished. Regarding your third question, you can add the latest year to the YEAR table to avoid that the latest year's data can't be rendered in table visual.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Using unpivot+matrix is the best solution to solve your three problems. (Years are multi-selected, unselected years are not shown in the visual, slicer options are from this table)&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 08:44:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4053499#M160855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-22T08:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Custom slicer to select and display multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4060222#M161161</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, this is looking great! Thank you so much for all the responses. Really appreciate it!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 02:52:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-slicer-to-select-and-display-multiple-columns/m-p/4060222#M161161</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-25T02:52:01Z</dc:date>
    </item>
  </channel>
</rss>

