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.
Hi All,
I am a new user of Power BI and stuck in between to get this data.
I have a data with Current year and previous year where i have a material which is purchased with different vendors ( multiple vendors with multiple purchases). I have to find the Average of each material and compare it with the previous year and to multiply with current year Quantity to get the PPC (purchase price calcuation) PPC formula is APP (average purchase Price) FY - APP PY * FY Quantity.
Can anyone help with me urgently with this calculation ?
Thanks in advance.
Regards
Vani Y N
Solved! Go to Solution.
Hi @VANI_YN_80 ,
According to my understanding, you want to calculate value based on each material using this calculation :
(average price of this year - average price of last year) * total quantity of this year
If so, I have built some data for test. Please check:
You could use the following formula to create a column:
PPC Column =
VAR _appFY =
CALCULATE (
AVERAGE ( 'Table'[Price] ),
ALLEXCEPT ( 'Table', 'Table'[Material] ),
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () )
)
VAR _QuaFY =
CALCULATE (
SUM ( 'Table'[Quantity] ),
ALLEXCEPT ( 'Table', 'Table'[Material] ),
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () )
)
VAR _appPY =
CALCULATE (
AVERAGE ( 'Table'[Price] ),
ALLEXCEPT ( 'Table', 'Table'[Material] ),
YEAR ( 'Table'[Date] )
= YEAR ( TODAY () ) - 1
)
RETURN
( _appFY - _appPY ) * _QuaFY
The final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @VANI_YN_80 ,
According to my understanding, you want to calculate value based on each material using this calculation :
(average price of this year - average price of last year) * total quantity of this year
If so, I have built some data for test. Please check:
You could use the following formula to create a column:
PPC Column =
VAR _appFY =
CALCULATE (
AVERAGE ( 'Table'[Price] ),
ALLEXCEPT ( 'Table', 'Table'[Material] ),
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () )
)
VAR _QuaFY =
CALCULATE (
SUM ( 'Table'[Quantity] ),
ALLEXCEPT ( 'Table', 'Table'[Material] ),
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () )
)
VAR _appPY =
CALCULATE (
AVERAGE ( 'Table'[Price] ),
ALLEXCEPT ( 'Table', 'Table'[Material] ),
YEAR ( 'Table'[Date] )
= YEAR ( TODAY () ) - 1
)
RETURN
( _appFY - _appPY ) * _QuaFY
The final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.