<?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: Creating Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2628674#M76802</link>
    <description>&lt;P&gt;I need average of landing rate(which is varing every month) for current and previous month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sum of sales. Please help me for this.&lt;/P&gt;</description>
    <pubDate>Sat, 09 Jul 2022 07:11:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-09T07:11:53Z</dc:date>
    <item>
      <title>Creating Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2626911#M76693</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I need help from you guys.&lt;/P&gt;&lt;P&gt;I have a column name- Landed rate( which is variable, every month is changing)&lt;/P&gt;&lt;P&gt;i need average of Landed rate for current month minus last month.&lt;/P&gt;&lt;P&gt;please me out with this.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 07:03:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2626911#M76693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-08T07:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2627098#M76704</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , You can use measure that can give this month vs last month data &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;BR /&gt;last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))&lt;BR /&gt;last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or trailing 1 month meausre&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MTD = &lt;BR /&gt;var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())&lt;BR /&gt;var _min = eomonth(_max,-1)+1 ,&lt;BR /&gt;return&lt;BR /&gt;CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))&lt;/P&gt;
&lt;P&gt;This Month = &lt;BR /&gt;var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)&lt;BR /&gt;var _min = eomonth(_max,-1)+1 ,&lt;BR /&gt;return&lt;BR /&gt;CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;LMTD = &lt;BR /&gt;var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())&lt;BR /&gt;var _max = date(Year(_max1), month(_max1)-1, day(_max))&lt;BR /&gt;var _min = eomonth(_max1,-2)+1 &lt;BR /&gt;return&lt;BR /&gt;CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last Month = &lt;BR /&gt;var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())&lt;BR /&gt;var _max = eomonth(_max1,-1)&lt;BR /&gt;var _min = eomonth(_max1,-2)+1 &lt;BR /&gt;return&lt;BR /&gt;CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI — Month on Month with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=6LUBbvcxtKA" target="_blank"&gt;https://www.youtube.com/watch?v=6LUBbvcxtKA&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :&lt;A href="https://youtu.be/OBf0rjpp5Hw" target="_blank"&gt;https://youtu.be/OBf0rjpp5Hw&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4" target="_blank"&gt;https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4&lt;/A&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 08:16:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2627098#M76704</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-08T08:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2628674#M76802</link>
      <description>&lt;P&gt;I need average of landing rate(which is varing every month) for current and previous month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sum of sales. Please help me for this.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2022 07:11:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2628674#M76802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-09T07:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2630201#M76913</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can follow the below steps:&lt;/P&gt;&lt;P&gt;1.Add a new column in the table&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cur_Minus_PreviousLandRate =
VAR cur_landrate = 'Table'[LandRate]
VAR cur_month = 'Table'[Month]
VAR previous_month = cur_month - 1
VAR previous_lanrate =
    CALCULATE (
        MAX ( 'Table'[LandRate] ),
        FILTER ( 'Table', 'Table'[Month] = previous_month )
    )
RETURN
    cur_landrate - previous_lanrate&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2.Create a measure to calculate the average about the new added column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg_Diff_LandRate =
AVERAGE ( 'Table'[Cur_Minus_PreviousLandRate] )&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Community Support Team_ Binbin Yu&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&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>Mon, 11 Jul 2022 08:12:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Measure/m-p/2630201#M76913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-11T08:12:30Z</dc:date>
    </item>
  </channel>
</rss>

