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

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