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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Sudharsanan
Helper III
Helper III

Variable Table and measure calculation

Hi All,

 

I have a case where i need to group a set of data and bring the average. 

 

Below is my dataset and i need to group the products to have the sales and qty value and then i need to Avg.

 

ProductSalesQty
AA160.72282.0000
BB81.88641.0000
AA37.74681.0000
AA80.7641.0000
AA80.7641.0000

 

Expected grouping

 

ProductSum of SalesSum of Qty

AA359.99765
BB81.88641

 

Expected Avg value for both : 

ProductSum of SalesSum of QtyAvg
AA359.9976571.99952
BB81.8864181.8864

 

Final Avg for both the products shoudl be as 

76.94296

 

i dont want to create an additional table but wanted to have the above calculations as meaasure.

thanks for you support as always.

1 ACCEPTED SOLUTION

Ah okay so the final average needs to be an average of the average measure,

 

try looking at these:

 

https://community.powerbi.com/t5/Desktop/Average-of-measure/td-p/50935

https://community.powerbi.com/t5/Desktop/calculate-average-of-calculated-measure/td-p/568198

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

5 REPLIES 5
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

this measure should work for the sum:  

Measure = CALCULATE(sum('Table'[Sales]),ALLEXCEPT('Table','Table'[Product]))
 
just create a 2nd one for QTY.
 
For the average:
 
Measure 2 = CALCULATE(AVERAGE('Table'[Sales]),ALLEXCEPT('Table','Table'[Product]))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Thanks @DOLEARY85 for quick response,

 

but i am not getting the answer as i expected.

Do you have any more info - can you share what you're seeing?

@DOLEARY85 i am getting a value of 73.65, but i need to get 76.94296

Ah okay so the final average needs to be an average of the average measure,

 

try looking at these:

 

https://community.powerbi.com/t5/Desktop/Average-of-measure/td-p/50935

https://community.powerbi.com/t5/Desktop/calculate-average-of-calculated-measure/td-p/568198

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors