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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
vishnuprashanth
Helper III
Helper III

change the value of the Grand total from sum of values to average in the matrix visual

I have a matrix visual like this attached. Is there any way I could change the grand total to the average value? 

Even in the Table view, I still have only the total value, instead, I want the average value to be present at the end of my table.

 

MatrixMatrix

Any suggestions to get achieve this, please?

PS: I don't want to change my values inside the matrix or tables to change to average and then sum it. 

6 REPLIES 6
ricardocamargos
Continued Contributor
Continued Contributor

Hi @vishnuprashanth,

 

You can do it by using the function HASONEVALUE, also you can change the calculation if necessary.

 

https://msdn.microsoft.com/en-us/query-bi/dax/hasonevalue-function-dax

 

 

 

Hi @ricardocamargos,

 

So I create the below HASONEVALUE func. This just calculates for the energy column. I want to create a measure that calculates for all the columns. 

IF (
    HASONEVALUE ( Table[athlete] ),
    SUM ( Table[Total Energy] ),
    AVERAGE (Table[Total Energy] )
)

 
Thanks. 

Anonymous
Not applicable

@vishnuprashanth

What if this measure is part of a Power BI matrix table and there are multiple fields under "Rows" which user might put in with their self service capabilities.

In that case, I cant choose to put HASONEVALUE for a single column and I cant HASONEVALUE for multiple columns.

Any suggestions on how we should do it in such case?


Regards

Hi @vishnuprashanth,

 

 

I think you have to create a measure for each column and customize the total for each one.

 

@ricardocamargos Thanks Ricardo 🙂 

Hi @ricardocamargos

Thanks for the suggestion. I read the HASONEVALUE function you had shared, but I still don't understand how it works and what attributes I need to give for the HASONEVALUE function. 

My Matrix visual and table are dynamic, I would want to change/select the date, name and other attributes. Could I still use HASONEVALUE for this? What is the change of calculation you were mentioning about? 

I am really sorry, very new to Power BI and DAX. Still learning them Smiley Frustrated

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors