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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JABF
Regular Visitor

Total Measure

How to have the total of a measure, so I can do the GT in DAX . 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @JABF ,

 

There are different ways to find the total measure in different scenarios. It depends on your application scenario. For example, if I want to get the summation result of the corresponding fields in the hierarchy in the matrix visual instead of the total, I can use functions like HASONEVALUE.

M_ =
VAR a =
    CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table' ) )
VAR b =
    CALCULATE (
        MAX ( 'Table'[Value] ),
        ALL ( 'Table' ),
        'Table'[Category] = MAX ( 'Table'[Category] )
    ) / a
RETURN
    IF ( HASONEVALUE ( 'Table'[ID] ), b, "which you want to calculate" )

vhenrykmstf_0-1644807876832.png

Also, you can read related blog as below.

Power bi measure divide + 9 examples - EnjoySharePoint

 

If the problem is still not resolved, could you further describe your requirements, provide the relevant test data and the desired results. I will answer your questions as soon as possible. Looking forward to your feedback.


Best Regards,
Henry


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

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @JABF ,

 

There are different ways to find the total measure in different scenarios. It depends on your application scenario. For example, if I want to get the summation result of the corresponding fields in the hierarchy in the matrix visual instead of the total, I can use functions like HASONEVALUE.

M_ =
VAR a =
    CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table' ) )
VAR b =
    CALCULATE (
        MAX ( 'Table'[Value] ),
        ALL ( 'Table' ),
        'Table'[Category] = MAX ( 'Table'[Category] )
    ) / a
RETURN
    IF ( HASONEVALUE ( 'Table'[ID] ), b, "which you want to calculate" )

vhenrykmstf_0-1644807876832.png

Also, you can read related blog as below.

Power bi measure divide + 9 examples - EnjoySharePoint

 

If the problem is still not resolved, could you further describe your requirements, provide the relevant test data and the desired results. I will answer your questions as soon as possible. Looking forward to your feedback.


Best Regards,
Henry


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

Tahreem24
Super User
Super User

@JABF Can you share some more details?

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Erk
Resolver I
Resolver I

Try something below

 

Grand Total:

Measure = CALCULATE(SUM(TableName[Value]),ALL(TableName))

Percentage of Grand Total:

 

Measure =
VAR vValue = SUM(TableName[Value]) 
VAR vTotalValue = CALCULATE(SUM(TableName[Value]),ALL(TableName))
RETURN 
DIVIDE(vValue ,vTotalValue ,0)

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.