cancel
Showing results for
Did you mean:
New Member

## Need average in row and total of average in sub total column

Hi Team, @amitchandak sir,

question:

 location status qualified intial NA total sum of average offshore average>>> 15 20 9 44 a 10 15 10 b 20 25 8

1 ACCEPTED SOLUTION
Community Support

Based on your description, I have create a simple sample:

Apply the measure to a matrix visual:

``````Measure =
SWITCH (
TRUE (),
ISINSCOPE ( 'Table'[ID] ) && ISINSCOPE ( 'Table'[Status] ), SUM ( 'Table'[Value] ),
ISINSCOPE ( 'Table'[Status] ) && NOT ( ISINSCOPE ( 'Table'[ID] ) ), AVERAGE ( 'Table'[Value] ),
NOT ( HASONEVALUE ( 'Table'[Status] ) ) && NOT ( HASONEVALUE ( 'Table'[ID] ) ),
SUMX (
SUMMARIZE (
'Table',
'Table'[Status],
"Average",
CALCULATE (
AVERAGE ( 'Table'[Value] ),
FILTER ( 'Table', [Status] = EARLIER ( 'Table'[Status] ) )
)
),
[Average]
)
)
``````

Change the name of Row and Column Subtotals:

Final output:

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

Based on your description, I have create a simple sample:

Apply the measure to a matrix visual:

``````Measure =
SWITCH (
TRUE (),
ISINSCOPE ( 'Table'[ID] ) && ISINSCOPE ( 'Table'[Status] ), SUM ( 'Table'[Value] ),
ISINSCOPE ( 'Table'[Status] ) && NOT ( ISINSCOPE ( 'Table'[ID] ) ), AVERAGE ( 'Table'[Value] ),
NOT ( HASONEVALUE ( 'Table'[Status] ) ) && NOT ( HASONEVALUE ( 'Table'[ID] ) ),
SUMX (
SUMMARIZE (
'Table',
'Table'[Status],
"Average",
CALCULATE (
AVERAGE ( 'Table'[Value] ),
FILTER ( 'Table', [Status] = EARLIER ( 'Table'[Status] ) )
)
),
[Average]
)
)
``````

Change the name of Row and Column Subtotals:

Final output:

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### 2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors