cancel
Showing results for 
Search instead for 
Did you mean: 

Table/Matrix Totals or Subtotals

Super User
6021 Views
Highlighted
Super User
Super User

Table/Matrix Totals or Subtotals

I have recently come across a lot of questions in the Power BI Community where people have created a measure in a matrix, but where the Subtotals and Grand Totals do not add up.

 

This Quick Measure will enable them to use this specifically for Matrix or Table visuals.

 

NAME:

Table/Matrix Totals 

DESCRIPTION:

This is to be specifically used when using a table or maxtrix visual and you want the totals to be correct.

PARAMETERS:

Name: Base value

Tooltip: The value you want to see the percent for

Type: Numerical field / measure

 

Name: Category

Tooltip: The category you want the overall total for

Type: Text/Date

 

DAX:

 

Matrix {Category} Totals =

IF(COUNTROWS(VALUES({Category})) = 1,
   {Base Value},
     SUMX(VALUES({Category}),
       {Base Value})

   )



 

Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"