cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajjadkhan253
New Member

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

Hi Team, @amitchandak sir,

 

question:

locationstatusqualifiedintialNAtotal sum of average
offshoreaverage>>>1520944
 a101510 
 b20258 

 

please help me to get desired result 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @sajjadkhan253 ,

 

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

vjianbolimsft_1-1670463420620.png

 

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]
        )
)

vjianbolimsft_2-1670463473790.png

Change the name of Row and Column Subtotals:

vjianbolimsft_0-1670463374225.png

 

Final output:

vjianbolimsft_3-1670463490986.png

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.

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @sajjadkhan253 ,

 

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

vjianbolimsft_1-1670463420620.png

 

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]
        )
)

vjianbolimsft_2-1670463473790.png

Change the name of Row and Column Subtotals:

vjianbolimsft_0-1670463374225.png

 

Final output:

vjianbolimsft_3-1670463490986.png

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.

Helpful resources

Announcements
Carousel_PBI_Wave1

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.

Power BI Summit Carousel 2

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!

Thank you 2022 Review

2022 Monthly Feature Releases

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