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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
nnouchi
Helper I
Helper I

Measure calculating fixed average price per month

Greetings all,

Is there a way to calculate a fixed average price by month? I’m required to factor in a set measure cost for avg unit prices per month.

Right now I can obtain a fixed price for all orders but am unsure on how to do this by month.

 

Formula for the average sale price per unit:

Avg Sale Price Per Unit = CALCULATE(DIVIDE(SUM(‘Warranty_Costs’[Net_Sales]),[Total Warranty Cores],1),ALLSELECTED(Warranty_Costs))

 

Any help would be greatly appreciated, thanks!

Nic

 

E-DNA.PNG

1 ACCEPTED SOLUTION

Hi @nnouchi ,

 

To use VALUES function could get the excepted result here.

 

Avg Sale Price Per Unit m = 
CALCULATE (
    DIVIDE ( SUM ( 'Warranty_Costs'[Net_Sales] ), [Total Warranty Cores], 1 ),
    ALLSELECTED ( Warranty_Costs ),
    VALUES ( 'Warranty_Costs'[Date].[Year] ),
    VALUES ( 'Warranty_Costs'[Date].[Month] )
)

Capture.PNG

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @nnouchi ,

 

Could you please share your sample data and excepted result to me if you don't have any Confidential Information.Please upload your files to One Drive and share the link here.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @nnouchi ,

 

To use VALUES function could get the excepted result here.

 

Avg Sale Price Per Unit m = 
CALCULATE (
    DIVIDE ( SUM ( 'Warranty_Costs'[Net_Sales] ), [Total Warranty Cores], 1 ),
    ALLSELECTED ( Warranty_Costs ),
    VALUES ( 'Warranty_Costs'[Date].[Year] ),
    VALUES ( 'Warranty_Costs'[Date].[Month] )
)

Capture.PNG

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thank you for the help, I was able to get my expected result through this function:

 

Avg Price Per Core By Month =
CALCULATE([Avg Sale Price Per Unit],
ALLEXCEPT(Warranty_Costs,Warranty_Costs[Month/Year]),VALUES(Warranty_Costs[Month/Year]))
 
 
 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors