<?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: How to return previous day's price based on irregular pricing intervals in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1266125#M21211</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 do not need to hardcode anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unpivoting your Table will get your Data in the correct order as you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recommed you see this video to understand more about Unpivoting your Tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=hGj2axffxHo" target="_blank"&gt;https://www.youtube.com/watch?v=hGj2axffxHo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=c6RJCg5XaRo" target="_blank"&gt;https://www.youtube.com/watch?v=c6RJCg5XaRo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Aug 2020 08:06:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-01T08:06:34Z</dc:date>
    <item>
      <title>How to return previous day's price based on irregular pricing intervals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1263074#M21090</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a table of price that looks like the below, and I'd like to create a measure that returns the previous day's price (second row)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1/1/2020&lt;/TD&gt;&lt;TD&gt;1/3/2020&lt;/TD&gt;&lt;TD&gt;1/7/2020&lt;/TD&gt;&lt;TD&gt;2/15/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Today's price&lt;/TD&gt;&lt;TD&gt;$10.00&lt;/TD&gt;&lt;TD&gt;$9.00&lt;/TD&gt;&lt;TD&gt;$8.00&lt;/TD&gt;&lt;TD&gt;$9.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Yesterday's price&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;$10.00&lt;/TD&gt;&lt;TD&gt;$9.00&lt;/TD&gt;&lt;TD&gt;$8.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I tried the following, but it return blank:&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculate(AVERAGE('Price'[Price_Per_Unit]), previousday('Pricing Window'[Price Window Start Date]) )&lt;/P&gt;&lt;P&gt;I suspect it is because the previous day (e.g., 1/6/2020), doesn't exist in "Pricing Window".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I go about resolving the issue? If I can return the previous pricing window's price, that works too. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 18:57:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1263074#M21090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-30T18:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to return previous day's price based on irregular pricing intervals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1263608#M21112</link>
      <description>&lt;P&gt;First thing you want to do is unpivot your table.&amp;nbsp; Then you can either use Power Query&amp;nbsp; (by merging the table with a copy of itself shifted by one row) or DAX with the regular "get data from previous row"&amp;nbsp; pattern.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 02:57:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1263608#M21112</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-31T02:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to return previous day's price based on irregular pricing intervals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1264387#M21138</link>
      <description>You want to make your columns rows and rows your columns. Then it'll be dead easy.</description>
      <pubDate>Fri, 31 Jul 2020 09:10:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1264387#M21138</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T09:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to return previous day's price based on irregular pricing intervals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1264741#M21150</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;Try unpivoting your Table/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paste this in Power Query Advance Editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCslPSayMKTUwMDIvVigoykxOVdJRUjE00DMwADEsobQFMj9WJ1opMrW4JLUIi14F3PpjYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"1/1/2020" = _t, #"1/3/2020" = _t, #"1/7/2020" = _t, #"2/15/2020" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"1/1/2020", Currency.Type}, {"1/3/2020", Currency.Type}, {"1/7/2020", Currency.Type}, {"2/15/2020", Currency.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"(blank)", "Price"}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Price"}, "Attribute", "Value"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Attribute", type date}}),
    #"Renamed Columns1" = Table.RenameColumns(#"Changed Type1",{{"Attribute", "Date"}, {"Price", "Day"}, {"Value", "Price"}})
in
    #"Renamed Columns1"&lt;/LI-CODE&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;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;</description>
      <pubDate>Fri, 31 Jul 2020 11:15:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1264741#M21150</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T11:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to return previous day's price based on irregular pricing intervals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1264958#M21166</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;Anonymous&lt;/LI-USER&gt;. However, my dates change as time passes, so I can't hard code them. Is there a way around it? Also, what do you mean by "unpivot the table"?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 13:19:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1264958#M21166</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T13:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to return previous day's price based on irregular pricing intervals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1265731#M21202</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have attached the PBIX and an Excel file with source data in the format you have, try entering more dates, prices, and refresh to check.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You can download the file:&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AmoScH5srsIYgYJtLd3267kr9_b4DQ?e=Fj1Gaw" target="_blank" rel="nofollow noopener noreferrer"&gt;HERE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;Did I answer your question? Mark this post as a solution, this will help others!.&lt;/P&gt;&lt;P&gt;Click on the Thumbs-Up icon on the right if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;YouTube, &lt;/A&gt;&lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;LinkedIn&lt;/A&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 21:05:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1265731#M21202</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-07-31T21:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to return previous day's price based on irregular pricing intervals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1266125#M21211</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 do not need to hardcode anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unpivoting your Table will get your Data in the correct order as you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recommed you see this video to understand more about Unpivoting your Tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=hGj2axffxHo" target="_blank"&gt;https://www.youtube.com/watch?v=hGj2axffxHo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=c6RJCg5XaRo" target="_blank"&gt;https://www.youtube.com/watch?v=c6RJCg5XaRo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 08:06:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-previous-day-s-price-based-on-irregular-pricing/m-p/1266125#M21211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-01T08:06:34Z</dc:date>
    </item>
  </channel>
</rss>

