Forum Discussion

ecarroll's avatar
ecarroll
Frequent Visitor
1 year ago
Solved

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 tha...
  • Anonymous's avatar
    Anonymous
    1 year ago

    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:

     

    I created the following measure to calculate CYTD.

     

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

     

     

    Output:

     

    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.