<?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: [Question] Filtering columns in a matrix visual with DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315770#M171376</link>
    <description>&lt;P&gt;Your metric slicer would have to be single select for this to work.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2024 20:06:40 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-12-05T20:06:40Z</dc:date>
    <item>
      <title>[Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4313824#M171298</link>
      <description>&lt;P&gt;I am trying to use a DAX measure to filter the columns in a matrix visualization based on different conditions. The DAX works well if I don't add any fields in the "rows".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;However, when I would like to show the breakdown, it will show all the columns.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is the DAX I am working on, are there any suggestion to solve this issue? Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;year filter =
VAR Selection = SELECTEDVALUE('Metrics'[Metrics])
VAR YearSelection = SELECTEDVALUE('Data release'[Year of data release])
VAR Mode = SELECTEDVALUE('STARTMODE'[Mode])

RETURN
IF (
    Selection = "A",
    IF (
        Mode = "Part-time",
        IF (
            MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 4 &amp;amp;&amp;amp;
            MAX(YEAR[YEAR]) &amp;gt;= YearSelection - 7,
            1,
            0
        ),
        IF (
            MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 3 &amp;amp;&amp;amp;
            MAX(YEAR[YEAR]) &amp;gt;= YearSelection - 6,
            1,
            0
        )
    ),
    IF (
        Selection = "B",
        IF (
            Mode = "Part-time",
            IF (
                MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 8 &amp;amp;&amp;amp;
                MAX(YEAR[YEAR]) &amp;gt;= YearSelection - 11,
                1,
                0
            ),
            IF (
                MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 6 &amp;amp;&amp;amp;
                MAX(YEAR[YEAR]) &amp;gt;= YearSelection - 9,
                1,
                0
            )
        ),
        IF (
            Selection = "C",
            IF (
                MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 3 &amp;amp;&amp;amp;
                MAX(YEAR[YEAR]) &amp;gt;= YearSelection - 6,
                1,
                0
            )
        )
    )
)&lt;/LI-CODE&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>Wed, 04 Dec 2024 16:38:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4313824#M171298</guid>
      <dc:creator>charonT</dc:creator>
      <dc:date>2024-12-04T16:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: [Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4314038#M171309</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:54:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4314038#M171309</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-04T20:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: [Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315360#M171353</link>
      <description>&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1SUiO9VjnHY5a3svdI58ElI8tuhcmnz7n/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1SUiO9VjnHY5a3svdI58ElI8tuhcmnz7n/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. I have uploaded the sample data. The output I expected is the sex table can filter the year based on the matrix and baseyear selected in the filter, similar to the table on the top.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 14:00:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315360#M171353</guid>
      <dc:creator>charonT</dc:creator>
      <dc:date>2024-12-05T14:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: [Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315497#M171359</link>
      <description>&lt;P&gt;I unpivoted the data table to make it usable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please explain what the year filter is supposed to achieve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 15:31:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315497#M171359</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-05T15:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: [Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315515#M171360</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Thank you! Here's what I'm aiming to achieve:&lt;/P&gt;&lt;P&gt;If Metric A is selected, the table should display YEAR ranging from BASEYEAR-3 to BASEYEAR-1.&lt;/P&gt;&lt;P&gt;If Metric B is selected, the table should display YEAR ranging from BASEYEAR-4 to BASEYEAR-2.&lt;/P&gt;&lt;P&gt;If Metric C is selected, the table should display YEAR ranging from BASEYEAR-5 to BASEYEAR-3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The year filter works perfectly when I don’t include any rows in the matrix. However, it stops working when I add "SEX" as a row in the table.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 15:46:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315515#M171360</guid>
      <dc:creator>charonT</dc:creator>
      <dc:date>2024-12-05T15:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: [Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315770#M171376</link>
      <description>&lt;P&gt;Your metric slicer would have to be single select for this to work.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 20:06:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4315770#M171376</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-05T20:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: [Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4316919#M171407</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I’m not sure if this is the case. I’ve set the slicer to single select, but the issue persists.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Dec 2024 11:17:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4316919#M171407</guid>
      <dc:creator>charonT</dc:creator>
      <dc:date>2024-12-06T11:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: [Question] Filtering columns in a matrix visual with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4317240#M171413</link>
      <description>&lt;P&gt;Thank you! I managed to sort this out on my own. The issue was that one of the DAX commands should have been set to &lt;STRONG&gt;MIN&lt;/STRONG&gt; instead of &lt;STRONG&gt;MAX&lt;/STRONG&gt;—a silly mistake on my part, haha. Interestingly, I’m not sure why it worked when there were no fields in the rows. The corrected DAX formula is provided below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;year filter =
VAR Selection = SELECTEDVALUE('Metrics'[Metrics])
VAR YearSelection = SELECTEDVALUE('Data release'[Year of data release])
VAR Mode = SELECTEDVALUE('STARTMODE'[Mode])

RETURN
IF (
    Selection = "A",
    IF (
        Mode = "Part-time",
        IF (
            MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 4 &amp;amp;&amp;amp;
            MIN(YEAR[YEAR]) &amp;gt;= YearSelection - 7,
            1,
            0
        ),
        IF (
            MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 3 &amp;amp;&amp;amp;
            MIN(YEAR[YEAR]) &amp;gt;= YearSelection - 6,
            1,
            0
        )
    ),
    IF (
        Selection = "B",
        IF (
            Mode = "Part-time",
            IF (
                MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 8 &amp;amp;&amp;amp;
                MIN(YEAR[YEAR]) &amp;gt;= YearSelection - 11,
                1,
                0
            ),
            IF (
                MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 6 &amp;amp;&amp;amp;
                MIN(YEAR[YEAR]) &amp;gt;= YearSelection - 9,
                1,
                0
            )
        ),
        IF (
            Selection = "C",
            IF (
                MAX(YEAR[YEAR]) &amp;lt;= YearSelection - 3 &amp;amp;&amp;amp;
                MIN(YEAR[YEAR]) &amp;gt;= YearSelection - 6,
                1,
                0
            )
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 14:46:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-Filtering-columns-in-a-matrix-visual-with-DAX/m-p/4317240#M171413</guid>
      <dc:creator>charonT</dc:creator>
      <dc:date>2024-12-06T14:46:34Z</dc:date>
    </item>
  </channel>
</rss>

