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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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