cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Post Patron

## Grand Total is not correct

Hi,

I have a matrix like this where amount is a measure. I am getting grand total incorrect as you can see.  There is some calculation in amount measure for Others.  It's ignoring the value for others.  I want to get 45 grand total.  How do I get the correct grand total?

 Employee Amount E1 10 E2 20 Others 15 Total 30
2 ACCEPTED SOLUTIONS
Community Champion

Which table is the Employee field in the visual coming from?

If it's the Employee table try:

``````AMOUNT =
SUMX (
'Employee',
CALCULATE (
SWITCH (
MAX ( Employee[Employee] ),
"Others", DIVIDE ( 150, 10 ),
DIVIDE ( [Target], [Num_weeks] )
)
)
)
``````

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Post Patron

Hi @PaulDBrown ,

It worked. Thank you so much for the solution.

8 REPLIES 8
Community Champion

Hi @bml123 ,

Create a another measure like this:-

``measure= sumx(summarize('table','table'[employee],"Correct_Sum",[amount]),[Correct_Sum]))``

Thanks,

Samarth

Best Regards,
Samarth

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

Community Champion

Try:

``Total amount = SUMX(Employee, [Amount])``

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Post Patron

I have tried your measue, it is not giving any values. It's just blank.

I want the grand total in my matrix to have the correct value.

Community Champion

Which table is the Employee field in the visual coming from?

If it's the Employee table try:

``````AMOUNT =
SUMX (
'Employee',
CALCULATE (
SWITCH (
MAX ( Employee[Employee] ),
"Others", DIVIDE ( 150, 10 ),
DIVIDE ( [Target], [Num_weeks] )
)
)
)
``````

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Post Patron

Hi @PaulDBrown ,

It worked. Thank you so much for the solution.

Post Patron

Employee is coming from employee table

Solution Sage

Would you share the amount measure?

Post Patron

Here is the formula of my Amount measure

Amount = SWITCH(CALCULATE(MAX(Employee[Employee])),
"Others",CALCULATE(150/10),
CALCULATE([Target] / [Num_weeks]))

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors