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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ecarroll
Frequent Visitor

Matrix Table - only total certain columns

I am looking to use a matrix table to total hours worked by week for the current month, but then also have a column for the current YTD hours for that employee, as well as the prior YTD hours for that employee. I have measures for the hours, CYTD hours and PYTD hours, but if I put all 3 measures into the matrix, it adds in the columns for the CYTD and PYTD for each week, but I only need those to show as totals. I've tried various methods (see links below) and can't get them to work. Every time I use SelectedValue, Max, or FirstNonBlank, it does not work. It seems my only option is to hide the columns, which is really not an option at all because this table needs to be automatically updated, not wait for someone to fix it cosmetically each week. Any help would be very much appreciated - if basic Power BI does not work, maybe someone knows of another matrix visual out there that could work? 

 

Thank you!!

ecarroll_0-1725393168452.pngecarroll_1-1725393175753.png

 



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ecarroll 

 

I created a simple sample data to do the test for your reference. In sample data, the data is from 1/1/2024 to today and there is only one employee with ID 1.

 

My sample:

vxuxinyimsft_0-1725430094959.png

 

I created the following measure to calculate CYTD.

 

CYTD = CALCULATE(SUM('Table'[workhours]), FILTER(ALL('Table'), [Date] >= DATE(2024, 1, 1) && [Date] <= TODAY()))

 

 

Output:

vxuxinyimsft_1-1725430512323.png

 

If this sample data is structurally different from the one you are using, please provide some sample data and the results based on sample data so that I can better help you. How to provide sample data in the Power BI Forum - Microsoft Fabric Community  Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @ecarroll 

 

I created a simple sample data to do the test for your reference. In sample data, the data is from 1/1/2024 to today and there is only one employee with ID 1.

 

My sample:

vxuxinyimsft_0-1725430094959.png

 

I created the following measure to calculate CYTD.

 

CYTD = CALCULATE(SUM('Table'[workhours]), FILTER(ALL('Table'), [Date] >= DATE(2024, 1, 1) && [Date] <= TODAY()))

 

 

Output:

vxuxinyimsft_1-1725430512323.png

 

If this sample data is structurally different from the one you are using, please provide some sample data and the results based on sample data so that I can better help you. How to provide sample data in the Power BI Forum - Microsoft Fabric Community  Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.