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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
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.