<?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 price of bike in the last month of selected period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3444379#M130933</link>
    <description>&lt;P&gt;It's a two step process. First find the max month of the selected period, then compute the value (via sum or max etc) for that month.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Sep 2023 20:24:59 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-09-23T20:24:59Z</dc:date>
    <item>
      <title>DAX measure for price of bike in the last month of selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3441645#M130758</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If i have 2 or more Bike names and and i want to select the prize for last month of the selected period.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;period&lt;/TD&gt;&lt;TD&gt;Bike prize&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.2023&lt;/TD&gt;&lt;TD&gt;2,35,599&lt;/TD&gt;&lt;TD&gt;Royal Enfield&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2.2023&lt;/TD&gt;&lt;TD&gt;2,34,999&lt;/TD&gt;&lt;TD&gt;Royal Enfield&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3.2023&lt;/TD&gt;&lt;TD&gt;2,35,999&lt;/TD&gt;&lt;TD&gt;Royal Enfield&lt;/TD&gt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gt;5.2023&lt;/TD&gt;&lt;TD&gt;1,26,849&lt;/TD&gt;&lt;TD&gt;BMW&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6.2023&lt;/TD&gt;&lt;TD&gt;1,26,544&lt;/TD&gt;&lt;TD&gt;BMW&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7.2023&lt;/TD&gt;&lt;TD&gt;1,27,999&lt;/TD&gt;&lt;TD&gt;BMW&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8.2023&lt;/TD&gt;&lt;TD&gt;1,25,899&lt;/TD&gt;&lt;TD&gt;BMW&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;For Example:- If i selected Royal enfield bike and the period is between 1.2023 to 5.2023 then the out put should be the last month of selected period.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;5.2023&lt;/TD&gt;&lt;TD&gt;2,35,499&lt;/TD&gt;&lt;TD&gt;Royal Enfield&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Can someone help me to get the DAX formula for the above issue.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 14:08:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3441645#M130758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-21T14:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure for price of bike in the last month of selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3444379#M130933</link>
      <description>&lt;P&gt;It's a two step process. First find the max month of the selected period, then compute the value (via sum or max etc) for that month.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 20:24:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3444379#M130933</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-09-23T20:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure for price of bike in the last month of selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3445187#M131056</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;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1)My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) Click "transform data" to enter the power query, click "Advanced Editor" to copy and paste the following code. Please check the steps in the right hand column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jZA9C8JADIb/itwcpL18XG4VHLu4OBwdBBWEorP/3lK5mogHboHnyZvwlhL6bewiBggRkIFznsfD43maNvv79XaZzmGEEqKxCHLDQpfVsshY2LzILosalhhLmheTt7rflv6VtfbVQ1SgpPO4G46+pYW9EypDwwRI0DAyrDZSGbs9JcvEMSYyLBmWvn5Rwxj0w8YX", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [period = _t, #"Bike prize" = _t, Name = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"period", type number}, {"Bike prize", Int64.Type}, {"Name", type text}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "period", "period - Copy"),
    #"Split Column by Delimiter" = Table.SplitColumn(Table.TransformColumnTypes(#"Duplicated Column", {{"period - Copy", type text}}, "en-US"), "period - Copy", Splitter.SplitTextByDelimiter(".", QuoteStyle.Csv), {"period - Copy.1", "period - Copy.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"period - Copy.1", Int64.Type}, {"period - Copy.2", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"period - Copy.2", "Year"}, {"period - Copy.1", "Month"}}),
    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Custom", each 1),
    #"Renamed Columns1" = Table.RenameColumns(#"Added Custom",{{"Custom", "Day"}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Renamed Columns1", {{"Year", type text}, {"Month", type text}, {"Day", type text}}, "en-US"),{"Year", "Month", "Day"},Combiner.CombineTextByDelimiter("-", QuoteStyle.None),"Merged"),
    #"Changed Type2" = Table.TransformColumnTypes(#"Merged Columns",{{"Merged", type date}}),
    #"Renamed Columns2" = Table.RenameColumns(#"Changed Type2",{{"Merged", "Year-Month"}}),
    #"Changed Type3" = Table.TransformColumnTypes(#"Renamed Columns2",{{"period", type text}})
in
    #"Changed Type3"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(3)We can create a measures.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag = IF(YEAR(MAX('Table'[Year-Month]))=YEAR(MAXX(ALLSELECTED('Table'),'Table'[Year-Month])) &amp;amp;&amp;amp; MONTH(MAX('Table'[Year-Month]))=MONTH(MAXX(ALLSELECTED('Table'),'Table'[Year-Month])),1,0)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Bike prize Measure = CALCULATE(MAX('Table'[Bike prize]),FILTER(ALLSELECTED('Table'),[Flag]=1))&lt;/LI-CODE&gt;
&lt;P&gt;(4)Place [Flag]=1 on the visual object filter and then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 05:39:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3445187#M131056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-25T05:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure for price of bike in the last month of selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3445553#M131080</link>
      <description>&lt;P&gt;Try something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last Month Bike Prize = LASTNONBLANKVALUE(Table[period],MIN(Table[Bike prize]))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Sep 2023 09:06:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-for-price-of-bike-in-the-last-month-of-selected/m-p/3445553#M131080</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-25T09:06:47Z</dc:date>
    </item>
  </channel>
</rss>

