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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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]
)

 










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


Proud to be a Super User!









"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]
)

 










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


Proud to be a Super User!









"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]
)

 










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


Proud to be a Super User!









"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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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