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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

Hi @Anonymous 

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
amitchandak
Super User
Super User

@Anonymous , 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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@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.

Anonymous
Not applicable

Hi @Anonymous 

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. 

Anonymous
Not applicable

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

Anonymous
Not applicable

Hi @Anonymous 

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

lbendlin
Super User
Super User

In your measure use 

 

HASONEVALUE(table[Employee])

 

to distinguish between the individual appointments and the column totals.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors