<?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: Dax query for making slicer with column name in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736253#M83929</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two methods.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;First one which I recommend is to edit the code of the table in a way that makes it unpivoted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 2nd solution is to create a new unpivoted calculated table using dax (refer to following code). However, this code shall provide an idea on how to edit the code of the original table&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewTable =
UNION (
    SELECTCOLUMNS (
        OldTable,
        "Category", OldTable[Category],
        "Year", 2021,
        "Total", OldTable[Total 2021]
    ),
    SELECTCOLUMNS (
        OldTable,
        "Category", OldTable[Category],
        "Year", 2022,
        "Total", OldTable[Total 2022]
    )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 30 Aug 2022 19:39:14 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-08-30T19:39:14Z</dc:date>
    <item>
      <title>Dax query for making slicer with column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736197#M83922</link>
      <description>&lt;P&gt;Hi Everyone,&lt;BR /&gt;&lt;BR /&gt;I wanted to create a slicer based on column name&lt;BR /&gt;I have created a visual based on two column 2021 and 2022 data, but I want a slicer name "2021" and "2022"&lt;BR /&gt;And when I click on 2021, it show visual values of 2021 Light Blue one and same for 2022 Dark Blue one&lt;BR /&gt;And If I don't click on anyone of slicer it shows the following&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 19:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736197#M83922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-30T19:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dax query for making slicer with column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736222#M83923</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you need first to unpivot the two columns using power query. The column names will become values of the Attributes column then you can use it for slicing&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 19:20:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736222#M83923</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-30T19:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dax query for making slicer with column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736227#M83924</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I have created this table based on other tables values, I can't take this table to Edit Query mode&lt;BR /&gt;If there is a way, then kindly guide me&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 19:23:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736227#M83924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-30T19:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dax query for making slicer with column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736253#M83929</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two methods.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;First one which I recommend is to edit the code of the table in a way that makes it unpivoted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 2nd solution is to create a new unpivoted calculated table using dax (refer to following code). However, this code shall provide an idea on how to edit the code of the original table&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;NewTable =
UNION (
    SELECTCOLUMNS (
        OldTable,
        "Category", OldTable[Category],
        "Year", 2021,
        "Total", OldTable[Total 2021]
    ),
    SELECTCOLUMNS (
        OldTable,
        "Category", OldTable[Category],
        "Year", 2022,
        "Total", OldTable[Total 2022]
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 30 Aug 2022 19:39:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-query-for-making-slicer-with-column-name/m-p/2736253#M83929</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-30T19:39:14Z</dc:date>
    </item>
  </channel>
</rss>

