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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mypowerbi1
Helper III
Helper III

Average below total in table or matrix

Hi,

I have to show average of the fields just below the total. There should be one more row for Average of Profit, Revenue and Tax field just below the total row. Please suggest how to do this.

mypowerbi1_0-1648818042771.png

Thanks

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @mypowerbi1 

 

Currently the table visual doesn't support to have two total rows at bottom. To display Total and Average values at the same time, you can create a table similar to below to get the Total and Average results in advance. Then append it to the original table with UNION function into a new calculated table. Or you can also select necessary columns from the original table and aggregate them before appending. 

vjingzhang_0-1649125485242.png

 

For example, original data table is like below

vjingzhang_1-1649126148582.png

You can use the following code to get a new table. Drag columns from this new table into a table visual. And turn off Totals option. 

Table 3 = 
var __table2 = 
{
    ( "Total", BLANK (), SUM ( 'Table'[Profit] ), SUM ( 'Table'[Revenue] ), SUM ( 'Table'[Tax] ) ),
    ( "Average", BLANK (), AVERAGE ( 'Table'[Profit] ), AVERAGE ( 'Table'[Revenue] ), AVERAGE ( 'Table'[Tax] ) )
}
return
UNION('Table',__table2)

vjingzhang_2-1649126490164.png

vjingzhang_3-1649127140558.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @mypowerbi1 

 

Currently the table visual doesn't support to have two total rows at bottom. To display Total and Average values at the same time, you can create a table similar to below to get the Total and Average results in advance. Then append it to the original table with UNION function into a new calculated table. Or you can also select necessary columns from the original table and aggregate them before appending. 

vjingzhang_0-1649125485242.png

 

For example, original data table is like below

vjingzhang_1-1649126148582.png

You can use the following code to get a new table. Drag columns from this new table into a table visual. And turn off Totals option. 

Table 3 = 
var __table2 = 
{
    ( "Total", BLANK (), SUM ( 'Table'[Profit] ), SUM ( 'Table'[Revenue] ), SUM ( 'Table'[Tax] ) ),
    ( "Average", BLANK (), AVERAGE ( 'Table'[Profit] ), AVERAGE ( 'Table'[Revenue] ), AVERAGE ( 'Table'[Tax] ) )
}
return
UNION('Table',__table2)

vjingzhang_2-1649126490164.png

vjingzhang_3-1649127140558.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.