Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ScottPat
Frequent Visitor

turning sporadic data points into regular ones

i have some data that represents purchases over time

it might look something like the below

DATE                        Value   item

jan 1                         5         spoon

jan 5                         5.2      spoon

jan 20                       5.3      spoon

feburary 10              5.4      spoon

April 10                    5.5      spoon

April 20                    5.6      spoon

 

I want to create data for every month that returns the most recent purchase.

 

DATE                        Value   item

Jan                           5         spoon

Feb                          5.3      spoon

Mar                         5.4      spoon

Apr                          5.4      spoon

May                         5.6      spoon

 

in practice the source data will have 20 different things (so not just the spoon) that we are buying so the value for each month is the most recent value specific to that item.

 

In case i am completly on the wrong track - the reason i am doing this is that I want to create a sort of 'Price Index' of all of these items and present them in a graph over time and I dont see an obvious solution with hte data as it is now.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ScottPat , this approach can help

 

https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

But I think index function with sort on date along with month should also help

 

Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U

 

calculate([Meausre], index(1, allselected(Date[Month], Date[Date]), orderby(Date[Date],desc),,partitionBy(Date[Month]) ) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
ScottPat
Frequent Visitor

Sorry  I had just allocated values based on the state at the 1st of the month. To me that difference was not important as the key thing is to get the concept.

 

that has of course has been answered by amitchandak in the other reply

thanks, accepting that as the answer.

Ashish_Mathur
Super User
Super User

Confusing question.  For Jan, the most recenut purchase was at a price of 5.3 (spoon).  Why are you showing 5?  Please review your result table carefully.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@ScottPat , this approach can help

 

https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

But I think index function with sort on date along with month should also help

 

Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U

 

calculate([Meausre], index(1, allselected(Date[Month], Date[Date]), orderby(Date[Date],desc),,partitionBy(Date[Month]) ) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.