cancel
Showing results for
Did you mean:
Highlighted
Helper II

## matrix total row based on sum of rows of a different column

Hi ,

I have a matrix that looks like below :

 employee 8/31/2020 9/1/2020 9/2/2020 9/3/2020 9/4/2020 John Open Open Open Abc Solutions Open Beth Open Open Omega technologies Open Open Mary Open Open Open Open Horizon solutions

I have a scheduledhours column measure that contains hours for every employee on a certain date.

I want to sum all the scheduled hours for a date and show it below like this in a matrix:

 employee 8/31/2020 9/1/2020 9/2/2020 9/3/2020 9/4/2020 John Open Open Open Abc Solutions Open Beth Open Open Omega technologies Open Open Mary Open Open Open Open Horizon solutions Total hours Sum(scheduledhours) Sum(scheduledhours Sum(scheduledhours Sum(scheduledhours Sum(scheduledhours

How can I do this ? Any suggestions are appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support

## Re: matrix total row based on sum of rows of a different column

Build a table like yours to have a test.

I use Hasonevalue function like

``````Measure =
IF (
HASONEVALUE ( 'Table'[Employee] ),
MAX ( 'Table'[Status] ),
SUMX (
FILTER ( 'Table', 'Table'[Date] = MAX ( 'Table'[Date] ) ),
'Table'[Scheduledhour]
)
)``````

Result:

You can download the pbix file from this link: matrix total row based on sum of rows of a different column

Best Regards,

Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 REPLIES 6
Highlighted
Super User II

## Re: matrix total row based on sum of rows of a different column

HASONEVALUE(table[Employee])

to distinguish between the individual appointments and the column totals.

Highlighted
Super User IV

## Re: matrix total row based on sum of rows of a different column

@darkbotrules , I do not see any scheduled hour here. Is the first table is matrix visual or your raw data. If it is raw data you need unpivot.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Proud to be a Super User!

Highlighted
Helper II

## Re: matrix total row based on sum of rows of a different column

@amitchandakthe first table is a matrix visual. I want to add a row at the end to show total sum of hours for every date column. I have a column called "ScheduledHours" added in the table but it is not added to the matrix visual.

Highlighted
Community Support

## Re: matrix total row based on sum of rows of a different column

Build a table like yours to have a test.

I use Hasonevalue function like

``````Measure =
IF (
HASONEVALUE ( 'Table'[Employee] ),
MAX ( 'Table'[Status] ),
SUMX (
FILTER ( 'Table', 'Table'[Date] = MAX ( 'Table'[Date] ) ),
'Table'[Scheduledhour]
)
)``````

Result:

You can download the pbix file from this link: matrix total row based on sum of rows of a different column

Best Regards,

Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper II

## Re: matrix total row based on sum of rows of a different column

Thanks @RicoZhou - will try and get back to you.

Highlighted
Community Support

## Re: matrix total row based on sum of rows of a different column

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

Best Regards,

Rico Zhou

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

#### Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors