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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ruxandraalina
Helper I
Helper I

Matrix with both total and average

Hello!

 

I need to create a matrix that shows monthly values (a count of tickets) by category, totals by category and averages by category, as below.

Months are to be selected from a slicer, so this is only an example. 

 

CategoryJanuaryFebruaryMarchTotalAverage
A582155.00
B656175.67
C368175.67
D121373210.67
E1545248.00

 

I've tried using the switch formula and it does work for monthly values, but i can't get the total and the average. 

 

If anyone could help, that would be much appreciated!

 

Thank you!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ruxandraalina ,

 

In this case, there are two values in the matrix, one calculated as the sum and one sum calculated as the average. Each value is pivoted, so that two values appear in each column of the matrix.

 

My idea is to hide the unwanted values, like this.

vcgaomsft_2-1659581233299.png

vcgaomsft_1-1659581170931.png

Here the Total column I am turning on the column subtotal and the average is adding the measure to the value.

Average = 
VAR _count_c = COUNT('Table'[Category])
VAR _count_m =DISTINCTCOUNT('Calendar'[Month])
VAR _result = DIVIDE(_count_c,_count_m)
RETURN
_result

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @ruxandraalina ,

 

In this case, there are two values in the matrix, one calculated as the sum and one sum calculated as the average. Each value is pivoted, so that two values appear in each column of the matrix.

 

My idea is to hide the unwanted values, like this.

vcgaomsft_2-1659581233299.png

vcgaomsft_1-1659581170931.png

Here the Total column I am turning on the column subtotal and the average is adding the measure to the value.

Average = 
VAR _count_c = COUNT('Table'[Category])
VAR _count_m =DISTINCTCOUNT('Calendar'[Month])
VAR _result = DIVIDE(_count_c,_count_m)
RETURN
_result

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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 Solution Authors