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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BPMGod
Regular Visitor

Compare latest unitprice * total quantity with values from year before or closest value to it

Hello,

 

I am new to this forum but I was able to find lots of help from the active topics from here. I have an issue with my current dashboard which I hope someone knows how to solve here (if possible).

 

I have purchase data since 2021, to be updated daily into the future. These data contain all articles with the date of purchase and unit prices. I want to create a measure for a card that will show me % year change and % month change. For this, I want to multiply the latest unit price with total overall quantity per article (some purchase could be done only once, some happen each month or daily) and compare it to unit price * total quantity (same quantity as for latest UP) from year before, or the closest date to it and the same for the last month or closest date to it.

 

Item nr.DatePurch. quantityUnit price 
18.1.202110497,48
17.6.202150613,05
17.1.2022100613,05
27.1.20211613,05
320.2.20215472,35
37.3.20215472,35
37.11.202151497,45
48.1.202110487,43
48.1.202210482,4
58.5.2021100402
68.1.20211402
68.3.20211402
68.6.20211452,25
68.10.20211804

 

This is an example of much longer data set, the expected result is something like this:

 

Item nr.DatePurch. quantityUnit price Total Q * UPLast valueLast years value
18.1.202110101600 1600
17.6.202150121920  
17.1.20221001524002400 
27.1.2021150505050
320.2.20215575 75
37.3.20215575  
37.11.202158120120 
48.1.20211015300 300
48.1.20221020400400 
58.5.20211005500500500
68.1.202112080 80
68.3.2021125100  
68.6.2021125100  
68.10.2021130120120 

 

Then the measure should just do 

Current/first % = (Last value-Last years value)/Last years value 
(3590-2605)/2605= 38%

 

Any help would be much appreciated!

1 REPLY 1
v-eqin-msft
Community Support
Community Support

Hi @BPMGod ,

 

Not very clear.

 

What's the logic of Total Q* UP / Last value? And are they measures or columns?

please share more detail information to help us clarify your scenario. Or share me with your pbix file after removing sensitive data.

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,
Eyelyn Qin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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