cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
puttaswamyrps
Helper I
Helper I

Previous Month Cost if dates sales not found

Hi Experts,

 

I need help for getting the previous month cost if the month is not matching.

 

Example

 

Input File  
ItemsMonthCost
ABC5/1/20181304.511
ABC6/1/20181318.111
ABC8/1/20181315.021
ABC9/1/20181315.211
ABC10/1/20181313.211
ABC11/1/20181324.321
ABC2/1/20191293.721
ABC3/1/20191293.521
ABC4/1/20191277.851

 

 

Output   
ItemsMonthCostRS Expected result
ABC1/1/2019 1324.321
ABC7/1/2018 1318.111

 

The question here since I don't have Jan - 2019 and July -2019 sales, it should find what is the latest previous month is available based on that it should give me the result

 

For:-  Jan-19 it's should take from Nov - 18

         Jul-18 it's should take from Jun - 18

 

Let me know if am not very clear 

 

Thanks

Putta

 

4 REPLIES 4
puttaswamyrps
Helper I
Helper I

Experts, someone take a look and advise how to achieve the result.

Anonymous
Not applicable

What is this? A measure? A calculated column? If it's a calculated column, why don't you do this in Power Query, where such a calculation truly belongs?

Best
Darek

This is an excel sheet data, I am loading to power BI, I need to know the sales if not available for the current month it should update the previous month

Anonymous
Not applicable

So then, why don't you create a spreadsheet where you've got all the months and calculate the cost for the missing months in there? Would that not be much easier?

If you don't want to do that for some reason, then I'll have to create a loading process in Power Query for you. Can you please share the spreadsheet via a link to OneDrive, Dropbox or Google Drive? I don't want to create it myself as I'm at work right now and busy... Thanks.

Best
Darek

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors