The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi there,
I have to use DAX to do this:
For Each Group of Material (first column) I want to calculate the difference of the price compared to previous row.
I tried to find a solution that is there but only found ways to do it without the partition of material (first column).
Thanks a lot
@hony , Try a new column like
New column =
var _max = maxx(filter(Table, [Material] = earlier([Material]) && [Date_eop] < earlier([Date_eop])), [Date_eop])
var _price =maxx(filter(Table, [Material] = earlier([Material]) && [Date_eop] < =_max), [price])
return
divide([price] -_price,_price)