<?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 Matrix visualizations and dynamically expand the last month, last week of the last month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-visualizations-and-dynamically-expand-the-last-month-last/m-p/3402709#M128515</link>
    <description>&lt;P&gt;Hello.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;I created matrix in power bi, the rows are months, weeks, and days. and the value is %sale.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My goal is to enable expansion solely for the most recent month. From there, I desire only the last week of that month to be expandable, while keeping all other periods unexpanded. Importantly, I'm aiming for this behavior to be dynamic—no matter the updates to data or dates, the expansion setup should remain consistent as I've outlined&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 17:22:41 GMT</pubDate>
    <dc:creator>razieh12</dc:creator>
    <dc:date>2023-08-28T17:22:41Z</dc:date>
    <item>
      <title>Matrix visualizations and dynamically expand the last month, last week of the last month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-visualizations-and-dynamically-expand-the-last-month-last/m-p/3402709#M128515</link>
      <description>&lt;P&gt;Hello.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;I created matrix in power bi, the rows are months, weeks, and days. and the value is %sale.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My goal is to enable expansion solely for the most recent month. From there, I desire only the last week of that month to be expandable, while keeping all other periods unexpanded. Importantly, I'm aiming for this behavior to be dynamic—no matter the updates to data or dates, the expansion setup should remain consistent as I've outlined&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 17:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-visualizations-and-dynamically-expand-the-last-month-last/m-p/3402709#M128515</guid>
      <dc:creator>razieh12</dc:creator>
      <dc:date>2023-08-28T17:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix visualizations and dynamically expand the last month, last week of the last month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-visualizations-and-dynamically-expand-the-last-month-last/m-p/3405616#M128675</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="603498" data-lia-user-login="razieh12" class="lia-mention lia-mention-user"&gt;razieh12&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I'd like to suggest you create a matrix with complete date range and Dax expression calculation result. You can create a measure formula to check the current date value and return flag.&lt;/P&gt;
&lt;P&gt;After these steps, you can use this as condition to use on ‘visual level filter’ to filter records based on flag.&lt;/P&gt;
&lt;P&gt;Sample formulas:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;lastMonth flag =
VAR currDate =
    MAX ( Table1[Date] )
VAR _sysDate =
    TODAY ()
RETURN
    IF ( currDate &amp;lt; DATE ( YEAR ( _sysDate ), MONTH ( _sysDate ), 1 ), "Y", "N" )
    
lastweek flag =
VAR currDate =
    MAX ( Table1[Date] )
VAR _sysDate =
    TODAY ()
VAR weekdayOffset =
    WEEKDAY ( _sysDate )
RETURN
    IF (
        currDate
            &amp;lt;= DATE ( YEAR ( _sysDate ), MONTH ( _sysDate ), DAY ( _sysDate ) - weekdayOffset ),
        "Y",
        "N"
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/applying-a-measure-filter-in-power-bi/" target="_blank"&gt;Applying a measure filter in Power BI - SQLBI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 02:16:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-visualizations-and-dynamically-expand-the-last-month-last/m-p/3405616#M128675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-30T02:16:40Z</dc:date>
    </item>
  </channel>
</rss>

