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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to show AVG value in Matrix visual instead of Row Total.

Hi Everyone,

I want to show Average instead of row total in matrix visual. Please help me with this.

 

yadhamurir_0-1674197679485.png

FYI, Please find the below attached snap for my requirement.

yadhamurir_2-1674198897709.png

 

 

Link for sample data: 
https://docs.google.com/spreadsheets/d/1ywvspnfl7O2DscU7HLRzDPMHd0iYAPwU/edit#gid=188546882

 

Thanks in Advance.

 

@amitchandak @PaulDBrown @Vvelarde @MarcelBeug @Greg_Deckler @johnt75 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see the attachment), please check if that is what you want. You can create a measure as below to replace the original one...

Measure = 
VAR _seldis =
    SELECTEDVALUE ( 'Table'[Discipline] )
VAR _sellevel =
    SELECTEDVALUE ( 'Table'[Level] )
VAR _sum =
    SUM ( 'Table'[Availability] )
VAR _ssum =
    CALCULATE (
        SUM ( 'Table'[Availability] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Discipline] = _seldis
                && 'Table'[Level] = _sellevel
        )
    )
VAR _scount =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Week] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Discipline] = _seldis
                && 'Table'[Level] = _sellevel
        )
    )
VAR _avg =
    DIVIDE ( _ssum, _scount )
RETURN
    IF ( ISINSCOPE ( 'Table'[Week] ), _sum, _avg )

yingyinr_0-1674458004727.png

In addition, you can refer the following links to get it.

ISINSCOPE – DAX Guide

Use IsInScope to get the right hierarchy level in DAX

 

If the above ones still not help you get the expected result, please provide more raw data in the table (exclude sensitive data) with Text format and your expected result with backend logic and special examples.It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see the attachment), please check if that is what you want. You can create a measure as below to replace the original one...

Measure = 
VAR _seldis =
    SELECTEDVALUE ( 'Table'[Discipline] )
VAR _sellevel =
    SELECTEDVALUE ( 'Table'[Level] )
VAR _sum =
    SUM ( 'Table'[Availability] )
VAR _ssum =
    CALCULATE (
        SUM ( 'Table'[Availability] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Discipline] = _seldis
                && 'Table'[Level] = _sellevel
        )
    )
VAR _scount =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Week] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Discipline] = _seldis
                && 'Table'[Level] = _sellevel
        )
    )
VAR _avg =
    DIVIDE ( _ssum, _scount )
RETURN
    IF ( ISINSCOPE ( 'Table'[Week] ), _sum, _avg )

yingyinr_0-1674458004727.png

In addition, you can refer the following links to get it.

ISINSCOPE – DAX Guide

Use IsInScope to get the right hierarchy level in DAX

 

If the above ones still not help you get the expected result, please provide more raw data in the table (exclude sensitive data) with Text format and your expected result with backend logic and special examples.It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Anonymous
Not applicable

Thanks for your solution.

pratyashasamal
Memorable Member
Memorable Member

Hi @Anonymous ,
You can create a measure and add it to matrix.

Then measure:

Measure =
var _average = calculate(AVERAGE('Table'[values]),REMOVEFILTERS('Months column'))
return
IF(SELECTEDVALUE('Months column'[month])="average",_average,SUM('Table'[values]))
Then you can remove the total column by going to
 marix properties->General->Row Totals on/off .
Thanks ,
Pratyasha Samal 
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Hi @pratyashasamal ,

Thanks for your solution. I have to create a measure by taking the refference of your measure, its working. 

yadhamurir_0-1674203569822.png

But, it gives average in column total, but my requirement is columns should be sum and i want to show row total as average. 

yadhamurir_1-1674203732426.png

FYI, please find the above attachment, the red highlited total column should be average, and remaining same as sum.

 

Hi @Anonymous ,
Try this type of measure once ,

Measure = IF(ISINSCOPE('Table'[category]),SUM('Table'[count]),AVERAGE('Table'[count]))

pratyashasamal_0-1674204800195.png

 

Thanks ,
Pratyasha Samal 
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

HI @pratyashasamal ,

I tried the same, even it gives the same result.

yadhamurir_0-1674205056046.png

 

Hi @Anonymous ,
Please check if this link is helpful for you : https://stackoverflow.com/questions/64869614/how-to-show-avg-value-in-matrix-widget-along-with-total-in-power-bi

https://stackoverflow.com/questions/66658350/power-bi-add-total-average-column-in-matrix

Thanks ,
Pratyasha Samal





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @Anonymous ,
Hope you were able to resolve the issue ?
Thanks ,
Pratyasha Samal





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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