<?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: Displaying columns based on user input. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3844466#M150271</link>
    <description>&lt;P&gt;&lt;A title="Sample input " href="https://docs.google.com/spreadsheets/d/1nHl88a0jURhK9H_iXLczpErvbcp7SKne7ow3eBaAJY4/edit?usp=drivesdk" target="_self"&gt;https://docs.google.com/spreadsheets/d/1nHl88a0jURhK9H_iXLczpErvbcp7SKne7ow3eBaAJY4/edit?usp=drivesdk&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2024 07:51:00 GMT</pubDate>
    <dc:creator>SM4</dc:creator>
    <dc:date>2024-04-17T07:51:00Z</dc:date>
    <item>
      <title>Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3843200#M150248</link>
      <description>&lt;P&gt;I am new to power bi so please forgive me if its a simple silly solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with data which has value for month-year for 2 years i.e. 24 columns, i want to creat a table/matrix wherein based on the users input of month and year all the columns till then would be displayed, for example if user input is Aug 23 all months from Jan 23 till Aug 23 should be displayed.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 03:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3843200#M150248</guid>
      <dc:creator>SM4</dc:creator>
      <dc:date>2024-04-17T03:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3843432#M150251</link>
      <description>&lt;P&gt;+1&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 05:05:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3843432#M150251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-17T05:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3843560#M150255</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="726175" data-lia-user-login="SM4" class="lia-mention lia-mention-user"&gt;SM4&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please provide sample input data&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 05:33:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3843560#M150255</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-04-17T05:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3844466#M150271</link>
      <description>&lt;P&gt;&lt;A title="Sample input " href="https://docs.google.com/spreadsheets/d/1nHl88a0jURhK9H_iXLczpErvbcp7SKne7ow3eBaAJY4/edit?usp=drivesdk" target="_self"&gt;https://docs.google.com/spreadsheets/d/1nHl88a0jURhK9H_iXLczpErvbcp7SKne7ow3eBaAJY4/edit?usp=drivesdk&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 07:51:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3844466#M150271</guid>
      <dc:creator>SM4</dc:creator>
      <dc:date>2024-04-17T07:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3845054#M150288</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="726175" data-lia-user-login="SM4" class="lia-mention lia-mention-user"&gt;SM4&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply from&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;Anonymous&lt;/a&gt;&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your concern about this case.&lt;BR /&gt;I noticed you sent the data link but unfortunately I don't have permission to access it.&lt;BR /&gt;When I try to access the data, the page shows the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:&lt;BR /&gt;The first thing I did was to create a date table with two years of time using the dax function.&lt;/P&gt;&lt;P&gt;Here is the dax function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table 2 = CALENDAR("2023-1-1","2024-12-31")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then duplicated this table and now have two identical data tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table = CALENDAR("2023-1-1","2024-12-31")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am creating a slicer with the table's column field with month as the filter criteria&lt;/P&gt;&lt;P&gt;You can add filters by year and month to the slicer clock.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I then used table2 to display the final results of the filter, and created a measure for table2 called "M_".&lt;BR /&gt;here is the dax code for ”M_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;M_ =
VAR _Slicer =
    MAX ( 'Table'[Date] )
VAR _Slicermonth =
    MONTH ( _Slicer )
RETURN
    IF (
        MAX ( 'Table 2'[Date] ) &amp;lt;= _Slicer
            &amp;amp;&amp;amp; YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( _Slicer ),
        MONTH ( MAX ( 'Table 2'[Date] ) ),
        BLANK ()
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The max function will filter out the maximum value of the current filter conditions&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now you can click on a month of a year in the filter to filter out data from January to the selected month of the year.&lt;/P&gt;&lt;P&gt;I hope my suggestions &amp;nbsp;give you good ideas, if you have any more questions, please clarify in a follow-up reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Carson Jian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 09:58:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3845054#M150288</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-17T09:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3845321#M150297</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="726175" data-lia-user-login="SM4" class="lia-mention lia-mention-user"&gt;SM4&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file the proposed solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 10:55:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3845321#M150297</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-04-17T10:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3878948#M151428</link>
      <description>&lt;P&gt;thank you so much, it helped a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is there a way to add a year filter as well? eg. Apr 24 would show only jan 24 to apr 24 not the other year&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 30 Apr 2024 10:15:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3878948#M151428</guid>
      <dc:creator>SM4</dc:creator>
      <dc:date>2024-04-30T10:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3882152#M151519</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="726175" data-lia-user-login="SM4" class="lia-mention lia-mention-user"&gt;SM4&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Month YTD = 
VAR Months = ALLNOBLANKROW ( 'Table'[Month Name], 'Table'[Month] )
RETURN
    GENERATE ( 
        Months,
        FILTER ( 
            SELECTCOLUMNS ( Months, "@Month", 'Table'[Month] ),
            [@Month] &amp;lt;= 'Table'[Month]
                &amp;amp;&amp;amp; YEAR ( [@Month] ) = YEAR ( 'Table'[Month] )
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 09:58:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3882152#M151519</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-01T09:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3955314#M153530</link>
      <description>&lt;P&gt;its a great solution &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just a question in the data set i see there is a column called target, in your solution i see its lost, if i suppose i want to keep the target column in my visual how would i do that?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 13:41:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3955314#M153530</guid>
      <dc:creator>kai25</dc:creator>
      <dc:date>2024-05-28T13:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying columns based on user input.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3958837#M153635</link>
      <description>&lt;P&gt;Also if i want to create a column in the visual to show the average of a few months sale, where the start month and end month is a user input,&lt;/P&gt;&lt;P&gt;how would I do that?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 18:45:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-columns-based-on-user-input/m-p/3958837#M153635</guid>
      <dc:creator>kai25</dc:creator>
      <dc:date>2024-05-29T18:45:45Z</dc:date>
    </item>
  </channel>
</rss>

