<?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 measure for conditional formatting for matrix table on cells in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-conditional-formatting-for-matrix-table-on-cells/m-p/3941815#M153252</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389075" data-lia-user-login="ChiRomeu" class="lia-mention lia-mention-user"&gt;ChiRomeu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try formula like below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;BookingStatus = 
VAR CurrentDate = SELECTEDVALUE(slicer[Date])
VAR CurrentBookings = CALCULATE(SUM(Bookings[Bookings]), Bookings[Date] = CurrentDate)
VAR LastMonth = CALCULATE(SUM(Bookings[Bookings]), DATEADD(Bookings[Date], -1, MONTH))
VAR TwoMonthsAgo = CALCULATE(SUM(Bookings[Bookings]), DATEADD(Bookings[Date], -2, MONTH))
VAR ThreeMonthsAgo = CALCULATE(SUM(Bookings[Bookings]), DATEADD(Bookings[Date], -3, MONTH))

RETURN
SWITCH(
    TRUE(),
    CurrentBookings &amp;gt; 0 &amp;amp;&amp;amp; LastMonth = 0 &amp;amp;&amp;amp; TwoMonthsAgo = 0 &amp;amp;&amp;amp; ThreeMonthsAgo = 0, 2,
    CurrentBookings = 0 &amp;amp;&amp;amp; LastMonth = 0 &amp;amp;&amp;amp; TwoMonthsAgo &amp;gt; 0 &amp;amp;&amp;amp; ThreeMonthsAgo &amp;gt; 0, 1,
    CurrentBookings = 0 &amp;amp;&amp;amp; LastMonth &amp;gt; 0 &amp;amp;&amp;amp; TwoMonthsAgo &amp;gt; 0 &amp;amp;&amp;amp; ThreeMonthsAgo &amp;gt; 0, 1,
    0
)
&lt;/LI-CODE&gt;
&lt;P&gt;Then create rule in conditional formatting:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 06:40:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-05-23T06:40:11Z</dc:date>
    <item>
      <title>Dax measure for conditional formatting for matrix table on cells</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-conditional-formatting-for-matrix-table-on-cells/m-p/3939476#M153169</link>
      <description>&lt;P&gt;Dear members,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please kindly help to solve the following problema:&lt;/P&gt;&lt;P&gt;I would like to have conditional formatting request in the matrix table: see the following picture&lt;/P&gt;&lt;P&gt;Green = 2&lt;/P&gt;&lt;P&gt;Red =1&lt;/P&gt;&lt;P&gt;Write=0&lt;/P&gt;&lt;P&gt;With color green:&lt;/P&gt;&lt;P&gt;If current month bookings &amp;gt; 0 and &amp;nbsp;last three months bookings = 0 then 2 (which means the cell of date (year-month) 2024-05 is green)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With color red:&lt;/P&gt;&lt;P&gt;Two requests:&lt;/P&gt;&lt;P&gt;No Regular red:&lt;/P&gt;&lt;P&gt;If current month and last month = 0 and -2 month and -3 month &amp;gt;0 then 1 (which means the cells of date (year-month) 2024-05 y 2024-04 are red)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regular red:&lt;/P&gt;&lt;P&gt;If current month =0 and last month &amp;gt; 0 and -2 month and -3 month &amp;gt;0 then 1 (which means the cell of date (year-month) 2024-05 is red)&lt;/P&gt;&lt;P&gt;Otherwise:&lt;/P&gt;&lt;P&gt;write&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Chi&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 11:21:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-conditional-formatting-for-matrix-table-on-cells/m-p/3939476#M153169</guid>
      <dc:creator>ChiRomeu</dc:creator>
      <dc:date>2024-05-22T11:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dax measure for conditional formatting for matrix table on cells</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-conditional-formatting-for-matrix-table-on-cells/m-p/3941815#M153252</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389075" data-lia-user-login="ChiRomeu" class="lia-mention lia-mention-user"&gt;ChiRomeu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try formula like below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;BookingStatus = 
VAR CurrentDate = SELECTEDVALUE(slicer[Date])
VAR CurrentBookings = CALCULATE(SUM(Bookings[Bookings]), Bookings[Date] = CurrentDate)
VAR LastMonth = CALCULATE(SUM(Bookings[Bookings]), DATEADD(Bookings[Date], -1, MONTH))
VAR TwoMonthsAgo = CALCULATE(SUM(Bookings[Bookings]), DATEADD(Bookings[Date], -2, MONTH))
VAR ThreeMonthsAgo = CALCULATE(SUM(Bookings[Bookings]), DATEADD(Bookings[Date], -3, MONTH))

RETURN
SWITCH(
    TRUE(),
    CurrentBookings &amp;gt; 0 &amp;amp;&amp;amp; LastMonth = 0 &amp;amp;&amp;amp; TwoMonthsAgo = 0 &amp;amp;&amp;amp; ThreeMonthsAgo = 0, 2,
    CurrentBookings = 0 &amp;amp;&amp;amp; LastMonth = 0 &amp;amp;&amp;amp; TwoMonthsAgo &amp;gt; 0 &amp;amp;&amp;amp; ThreeMonthsAgo &amp;gt; 0, 1,
    CurrentBookings = 0 &amp;amp;&amp;amp; LastMonth &amp;gt; 0 &amp;amp;&amp;amp; TwoMonthsAgo &amp;gt; 0 &amp;amp;&amp;amp; ThreeMonthsAgo &amp;gt; 0, 1,
    0
)
&lt;/LI-CODE&gt;
&lt;P&gt;Then create rule in conditional formatting:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 06:40:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-conditional-formatting-for-matrix-table-on-cells/m-p/3941815#M153252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-23T06:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dax measure for conditional formatting for matrix table on cells</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-conditional-formatting-for-matrix-table-on-cells/m-p/3943339#M153277</link>
      <description>&lt;P&gt;Hi Adamk&amp;nbsp; Kongs,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you for your help, but it is still not working, please see the following picture marked which violates the conditions put.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;beste regards&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 10:46:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-for-conditional-formatting-for-matrix-table-on-cells/m-p/3943339#M153277</guid>
      <dc:creator>ChiRomeu</dc:creator>
      <dc:date>2024-05-23T10:46:05Z</dc:date>
    </item>
  </channel>
</rss>

