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
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
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.