cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
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
Community Support

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

Hi @darkbotrules 

Build a table like yours to have a test.

1.png

I use Hasonevalue function like 

 

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

 

Result:

3.png

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. 

View solution in original post

6 REPLIES 6
Highlighted
Super User II
Super User II

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

In your measure use 

 

HASONEVALUE(table[Employee])

 

to distinguish between the individual appointments and the column totals.

Highlighted
Super User IV
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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper II
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
Community Support

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

Hi @darkbotrules 

Build a table like yours to have a test.

1.png

I use Hasonevalue function like 

 

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

 

Result:

3.png

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. 

View solution in original post

Highlighted
Helper II
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
Community Support

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

Hi @darkbotrules 

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

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

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