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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Dazzlerdb
Regular Visitor

Subtotal Problem

Hi, 

 

I have this great measure for calculating the number of hours per week based on a date range (which works really well and was lovingly helped by you guys)

 

Dazzlerdb_0-1709632445734.png

 

However, subtotalling doesnt work so there must be something in DAX formula to adjust and I cant figure it out. I am very wary of adjusting this formula as it was a nightmare to write!! As you can see the subtotal should be 102.88hrs, but is showing as 68.59hrs. perhaps I need another measure to subtotal this measure?

 

Dazzlerdb_1-1709632544494.png

 

Any help gratefully received 🙂

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Dazzlerdb ,

Base on your description, it seems like you got the incorrect total values in your matrix visual. You can create another new measure as below to replace the original measure [WeekHrs], put the fields in below screenshot in groupby part:

Measure =
SUMX (
    GROUPBY (
        'RPPlan',
        'RPPlan'[Project],
        'RPPlan'[field2],
        'RPPlan'[field3],
        'RPPlan'[field4],
        'RPPlan'[field5],
        'RPPlan'[field6],
        'RPPlan'[StartDate],
        'RPPlan'[EndDate],
        'RPPlan'[Hrs Per Day],
        'RPPlan'[xxhours]
    ),
    [WeekHrs]
)

vyiruanmsft_0-1709710799985.png

In addition, you can refer the following links to try to solve your problem...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

 

If the above ones can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Dazzlerdb ,

Base on your description, it seems like you got the incorrect total values in your matrix visual. You can create another new measure as below to replace the original measure [WeekHrs], put the fields in below screenshot in groupby part:

Measure =
SUMX (
    GROUPBY (
        'RPPlan',
        'RPPlan'[Project],
        'RPPlan'[field2],
        'RPPlan'[field3],
        'RPPlan'[field4],
        'RPPlan'[field5],
        'RPPlan'[field6],
        'RPPlan'[StartDate],
        'RPPlan'[EndDate],
        'RPPlan'[Hrs Per Day],
        'RPPlan'[xxhours]
    ),
    [WeekHrs]
)

vyiruanmsft_0-1709710799985.png

In addition, you can refer the following links to try to solve your problem...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

 

If the above ones can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

lbendlin
Super User
Super User

define "doesn't work".  Are you trying to subtotal by rep? If so then that field need to be included in the SUMMARIZECOLUMNS.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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