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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
muchtamo
New Member

Total column matrix are incorrect

Mohamad Muchtar Mohamad Muchtar 5 minutes ago Hello , I've problem with my dax formula, column totals are not equal to monthly total Forecast1 = if( CALCULATE(sum('dbprojects tbl_t_project_impact'[actual]))=0, SUMX('dbprojects tbl_t_project_impact',CALCULATE(SUM('dbprojects tbl_t_project_impact'[plan]))), sumx(values('dbprojects tbl_t_project_impact'),CALCULATE(SUM('dbprojects tbl_t_project_impact'[actual])) ))
3 REPLIES 3
Anonymous
Not applicable

Hi @muchtamo ,

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,
Stephen Tao

Anonymous
Not applicable

Hi @muchtamo ,

 

We usually use the SUMX function or the HASONEVALUE function to solve the problem of incorrect matrix Subtotals.

Try this

Total Actuals =
SUM ( 'dbprojects tbl_t_project_impact'[actual] ) 
Total Plan = 
SUM ( 'dbprojects tbl_t_project_impact'[plan] )
Forecast1  = 
IF (
     [Total Actuals] = 0,
    SUMX (
        'dbprojects tbl_t_project_impact',
        [Total Plan]
    ),
    SUMX (
         'dbprojects tbl_t_project_impact' ,
        [Total Actuals]
    )
)

 

Reference: DAX – Subtotals and Grand Totals That Add Up “Correctly”

 

Best Regards,

Stephen Tao

 

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

 

 

rajulshah
Resident Rockstar
Resident Rockstar

Hello @muchtamo ,

You would need to create 3 measures as follows:

Total Actuals =
   CALCULATE ( SUM ( 'dbprojects tbl_t_project_impact'[actual] ) )

Total Plan = 
   CALCULATE ( SUM ( 'dbprojects tbl_t_project_impact'[plan] )

Total Monthly Forecast = 
VAR ActualSum = [Total Actuals]
VAR PlanSum = [Total Plan]
RETURN
IF (
    ActualSum  = 0,
    SUMX (
        'dbprojects tbl_t_project_impact',
        [Total Plan]
    ),
    SUMX (
        VALUES ( 'dbprojects tbl_t_project_impact' ),
        [Total Actuals]
    )
)

 

And then plot the last measure in the chart and see the results.
Please let me know if this didn't work.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors
Top Kudoed Authors