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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
marsclone
Helper IV
Helper IV

Measure for average price

Hello,

 

I have a table with amount and quantity per location, per product, etc.

What is the best measure to calculate the average price.

At this moment i have the following:

 

Average Price = if(ISERROR(sum(Data[Revenu]) / sum(Data[Quantity]));"";(sum(Data[Revenu]) / sum(Data[Quantity])))
 
I also would like to know, how i can calculate the difference between the price from 2018 and 2017?
 
My testfile is:
 
 
Thank you!
Regards Marcel

 

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @marsclone ,

Do you want to get the output below?

Capture.PNG

If it is, you could create the measure below.

difference price =
VAR average_price_2017 =
    CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2017 ) )
VAR average_price_2018 =
    CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2018 ) )
RETURN
    average_price_2018 - average_price_2017

If you still need help, please share your desired output.

In addition, please mask sensitive data before uploading.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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-piga-msft
Resident Rockstar
Resident Rockstar

Hi @marsclone ,

Do you want to get the output below?

Capture.PNG

If it is, you could create the measure below.

difference price =
VAR average_price_2017 =
    CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2017 ) )
VAR average_price_2018 =
    CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2018 ) )
RETURN
    average_price_2018 - average_price_2017

If you still need help, please share your desired output.

In addition, please mask sensitive data before uploading.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-piga-msft 

 

Hello Cherry,

 

Thank you for your help! This will work!

 

Is this a better solution instead of measures calculating (Amount YTD & Quantity YTD) and (Amount LY & Quantity LY) and divide those and substract?

 

Regards Marcel

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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