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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MRR
New Member

Previous price

Hi All,

 

Tried to find a solution but I cannot seem to find it.

 

I got this tabel:

T_DossierDetail   
    
PartcodePricedatePriceCustldCurrprice
A1-1-202010000100
B1-1-202012000200
C1-1-202010000300
D1-1-202012000400
A2-2-202010000150
B2-2-202012000200
C2-2-202010000300
D2-2-202012000450
A3-3-202010000150
B3-3-202012000250
C3-3-202010000350
D3-3-202012000450

 

I have a measure for last price by month

Price month 03 = CALCULATE(MAX(T_DossierDetail[CurrPrice]),'date'[Month]=3)
 
What I'm looking for is a formule for previous price, so partcode A actual price is 150 and I would like a colum/measure, that gives me a result of 100, because that is the previous price.
 
To make it even harder I would like to have it on partcode and pricecustId.
 
Anyone?

 

1 REPLY 1
amitchandak
Super User
Super User

@MRR , Try a new column like

 

new column =
var _max = maxx(filter(table, [Partcode] = earlier([Partcode]) && [Pricedate] <earlier(Pricedate)),[Pricedate])
return
maxx(filter(table, [Partcode] = earlier([Partcode]) && [Pricedate] =_max ),[Currprice])

 

 

Refer last noncontinuous date logic in this blog for measure

 

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.