<?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: Address &amp;quot;previous&amp;quot; column value for measures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4280052#M169859</link>
    <description>&lt;P&gt;unfortunately, the formula doesnt work, it says that this line&lt;/P&gt;&lt;PRE&gt;    'Date'[Month] = CurrentMonthNum - 1&lt;/PRE&gt;&lt;P&gt;compares two different types of data, text and number.&lt;/P&gt;&lt;P&gt;is there any way to just address the previous column without the data table?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2024 15:01:48 GMT</pubDate>
    <dc:creator>cerebro</dc:creator>
    <dc:date>2024-11-12T15:01:48Z</dc:date>
    <item>
      <title>Address "previous" column value for measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279825#M169842</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would like to see the change in customer margins from month to month in a measure with the help of month number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data is on a daily basis, previous month functions do not perform.&lt;/P&gt;&lt;P&gt;And ideally i would like to change the margin value into red or green if it goes up or down.&lt;/P&gt;&lt;P&gt;Can someone please help?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 12:35:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279825#M169842</guid>
      <dc:creator>cerebro</dc:creator>
      <dc:date>2024-11-12T12:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Address "previous" column value for measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279905#M169848</link>
      <description>&lt;P&gt;Make sure that you have a properly formatted date table, marked as a date table. You can then create a measure like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Margin MoM % =
VAR CurrentMargin = [Margin]
VAR PrevMargin =
    CALCULATE ( [Margin], DATEADD ( 'Date'[Date], -1, MONTH ) )
VAR Result =
    DIVIDE ( CurrentMargin - PrevMargin, PrevMargin )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Nov 2024 13:36:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279905#M169848</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-11-12T13:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Address "previous" column value for measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279940#M169851</link>
      <description>&lt;P&gt;thank you very much, the formula works but only with month number. our date table looks like this and i can not change anything about it, the whole data model was created by an IT consultant and i can only create measure in a dashboard.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Can you please modify the formula that it contains month number or maybe you have an idea how i can adresse the date in the table from the sceenshot?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 14:15:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279940#M169851</guid>
      <dc:creator>cerebro</dc:creator>
      <dc:date>2024-11-12T14:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Address "previous" column value for measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279967#M169853</link>
      <description>&lt;P&gt;I think that the formula I gave should still work, but if not you can try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Margin MoM % =
VAR CurrentMargin = [Margin]
VAR CurrentMonthNum =
    MAX ( 'Date'[Month] )
VAR PrevMargin =
    CALCULATE (
        [Margin],
        REMOVEFILTERS ( 'Date' ),
        VALUES ( 'Date'[Year] ),
        'Date'[Month] = CurrentMonthNum - 1
    )
VAR Result =
    DIVIDE ( CurrentMargin - PrevMargin, PrevMargin )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Nov 2024 14:25:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4279967#M169853</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-11-12T14:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Address "previous" column value for measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4280052#M169859</link>
      <description>&lt;P&gt;unfortunately, the formula doesnt work, it says that this line&lt;/P&gt;&lt;PRE&gt;    'Date'[Month] = CurrentMonthNum - 1&lt;/PRE&gt;&lt;P&gt;compares two different types of data, text and number.&lt;/P&gt;&lt;P&gt;is there any way to just address the previous column without the data table?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 15:01:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4280052#M169859</guid>
      <dc:creator>cerebro</dc:creator>
      <dc:date>2024-11-12T15:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Address "previous" column value for measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4285361#M170098</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="328680" data-lia-user-login="cerebro" class="lia-mention lia-mention-user"&gt;cerebro&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to display Revenue per customer on a monthly basis and show the growth rate compared to the previous month?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my test and attached pbix file for your reference.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Margin = VAR currentMonth = MONTH(MAX('Table'[Date]))
VAR lastMonth = currentMonth-1
VAR cust = MAX('Table'[Customer])
VAR lastRev = CALCULATE(SUM('Table'[Revenue]),ALL('Table'),MONTH('Table'[Date])=lastMonth&amp;amp;&amp;amp;'Table'[Customer]=cust)
RETURN IF(CONTAINS(ADDCOLUMNS(ALL('Table'[Date]),"Month",MONTH('Table'[Date])),[Month],lastMonth),(SUM('Table'[Revenue])-lastRev)/lastRev)&lt;/LI-CODE&gt;
&lt;P&gt;The 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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Mengmeng Li&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 06:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Address-quot-previous-quot-column-value-for-measures/m-p/4285361#M170098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-15T06:25:17Z</dc:date>
    </item>
  </channel>
</rss>

