cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Lucy_Ramirez
Frequent Visitor

Incremento por producto

Hola

Me puedes ayudar? Estoy intentando calcular el incremento de precio por tamaño de producto.

Mi tabla esta de la siguiente manera:

 Precio
REFRESCO 16 OZ$55
REFRESCO 22 OZ$60
REFRESCO 32 OZ$65
REFRESCO 44 OZ$70

 

Necesito que mi formula me diga cual es el porcentaje de incremento entre cada tamaño de refresco, me gustaría que la formula me mostrara la formula de incremento:

 PrecioIncremento
REFRESCO 16 OZ$55N/A
REFRESCO 22 OZ$609.09%
REFRESCO 32 OZ$658.33%
REFRESCO 44 OZ$707.69%

 

Muchas gracias!

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @Lucy_Ramirez ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1695089429442.png

(2)Click "transform data" to go to the power query editor and add a index column.

(3) We can create a measure. 

Incremento = VAR _a= CALCULATE(MAX('Table'[Precio]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1))
var _b=MAX('Table'[Precio])
var _c=DIVIDE(_b-_a,_a,0)
return IF(_c=0,"N/A",_c)

(4) Then the result is as follows.

vtangjiemsft_1-1695089542678.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @Lucy_Ramirez ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1695089429442.png

(2)Click "transform data" to go to the power query editor and add a index column.

(3) We can create a measure. 

Incremento = VAR _a= CALCULATE(MAX('Table'[Precio]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1))
var _b=MAX('Table'[Precio])
var _c=DIVIDE(_b-_a,_a,0)
return IF(_c=0,"N/A",_c)

(4) Then the result is as follows.

vtangjiemsft_1-1695089542678.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

amitchandak
Super User
Super User

@Lucy_Ramirez , Create a new column

 

New colum =

var _min = minx(filter(Table, [Item] =earlier([Item])), [Size])

var _price= maxx(filter(Table, [Item] =earlier([Item]) && [Size] =_min), [Precio]) 

return

divide([Precio] -_price, _price)

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors