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
rgoo
Frequent Visitor

Custom calculation for matrix row sub total

This is my table:

ronaldgooh_1-1713926644279.png


and this is the matrix visual i have done:

ronaldgooh_2-1713926805792.png

right now the Total row is just summing up all the rows but what i want is to add my own custom Total's rows
to achieve something like this:

 

ronaldgooh_3-1713926864058.png

the dax calculation for the productivity 2023/24 and Var % total is: 

 

 

productivity 23 = DIVIDE('shipment 23 '[First cost 2023 ], 'headcount'[HC 23]  )
productivity 24 = DIVIDE('shipment 24 '[First cost 2024 ], 'headcount '[HC 24])

 

 

 

 

 

Var % = 
DIVIDE(
    ([productivity 2024] - [productivity 2023]),
    [productivity 2023],
    BLANK()
)

 

 

 

1 ACCEPTED SOLUTION

Hi @rgoo ,

 

What measure did you write?

For  Productivity 2023, you should be writing something like:

Productivity 23 (2) = 
IF (
    NOT ( HASONEVALUE ( 'table'[Office column] ) ),
    [custom total measure],
    [the measure used in productivity 23 column]
)

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @rgoo

 

try something like this:

IF (
    NOT ( HASONEVALUE ( 'table'[Office] ) ),
    [desired total],
    [the other measure]
)

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

hi, thank you for your response, i have created the measure but it is showing the total productivity for 2024 only, in a new column.

ronaldgooh_0-1713939084421.png

I was wondering if it's possible to add it to the bottom of the matrix as the last row with the first column named: total followed by productivity 23 ,productivity 24 and var % value.

somthing like this:

ronaldgooh_1-1713939297465.png

 

 i am using card visual to display the custom total values as of now.

Hi @rgoo ,

 

What measure did you write?

For  Productivity 2023, you should be writing something like:

Productivity 23 (2) = 
IF (
    NOT ( HASONEVALUE ( 'table'[Office column] ) ),
    [custom total measure],
    [the measure used in productivity 23 column]
)

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

ahhh i created a new measure which led to a different outcome, i understand now. Thank you

Helpful resources

Announcements
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!

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