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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
VANI_YN_80
Regular Visitor

HELP IN CALCULATED COLUMN

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

Material-Price.PNG

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:

PPC.PNG

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.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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:

Material-Price.PNG

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:

PPC.PNG

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.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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

Top Solution Authors