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

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.

Reply
bheinrich
Frequent Visitor

Average of Subtotals

Hello,

 

I need to generate an average of the subtotals in the below grouping per quarter.  For Q1, It is showing $469,814, but should be $100,431 (the sume of all the grouped names divided by 5).

 

Here is my current measure:

Cost per Day Average = AVERAGEX(VALUES('Frac Detail'[Zipper_Frac_Pad]),AVERAGEX(VALUES('Frac Detail'[Well]),DIVIDE([Daily Costs],'Frac Detail'[Frac Days])))

 

 Cost Per Day.PNGCost Per Day Chart.PNG

 

Any tips? Thank you.

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @bheinrich,

 

You may try to create a measure similar to:

 

Cost per Day Average =
CALCULATE (
    SUM ( [Costs] ),
    ALLEXCEPT ( table, table[YearNo], table[QuarterNo] )
)
    / CALCULATE (
        DISTINCTCOUNT ( [grouped names] ),
        ALLEXCEPT ( table, table[YearNo], table[QuarterNo] )
    )
 
For more advice, please share sample data stored in original data tables.
 
Regards,
Yulana Gu
Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bheinrich
Frequent Visitor

Here is the chart using Cost per Day Average.. it's basically just averaging each name & not the grouping cost per day.  I just need to find a way to average the groupings. Average Cost per Day Chart.PNG

This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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