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
Unknown1996
Regular Visitor

Wrong totals while calculating percentages

While calculating the percentage I’m getting wrong totals and I’m using the following code for it (

Asset Suite2851orders = VAR A=CALCULATE (SUM('SFDC Won 2851(orders) ' [Total Sales Price (converted)]),FILTER('SFDC Won

ro

2851 (orders)', 'SFDC Won 2851(orders)' [New Product line Assignement] IN {"Asset Suite"}))

VAR B

= DIVIDE (CALCULATE (SUM('SFDC Won 2851(orders) ' [Total Sales Price (converted) 1), FILTER('SFDC Won 2851(orders) ',

'SFDC Won 2851(orders) ' [New Product line Assignement] IN {"Asset Suite"})), [Orders2851_PL(total)_Without_Notallocated], 0)

1 ACCEPTED SOLUTION

Hi @Unknown1996 ,

 

This is due to CALCULATE triggers context transition. I think this article gives a good explanation of it.

 

vtangjiemsft_1-1693983876167.pngvtangjiemsft_2-1693983928438.png

Best Regards,

Neeko Tang

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

11 REPLIES 11
v-tangjie-msft
Community Support
Community Support

Hi @Unknown1996 ,

 

You can create a new measure to be placed on the visual object instead of the old one.

NewMeasure = SUMX(VALUES(Table[Column]), [YourCurrentMeasure])

 

Use you table and column name used on the rows in your visual, but this will give you the correct results in both your rows and "Total".

 

Best Regards,

Neeko Tang

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

 

If I create a new measure and like you mentioned and use it means I’m getting the correct totals but when I put your measure inside a VAR and used in the dax means it’s giving me wrong total again but both the formulas are same why they are working different 

Hi @Unknown1996 ,

 

This is due to CALCULATE triggers context transition. I think this article gives a good explanation of it.

 

vtangjiemsft_1-1693983876167.pngvtangjiemsft_2-1693983928438.png

Best Regards,

Neeko Tang

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

image.jpg

Got the total as correct value now excellent but when I’m using it in the variable inside another dax formula again it’s showing wrong total can you help me with that 

Tried but not getting correct values,can you exactly tell me where to place your dax and rewrite it ?

Unknown1996
Regular Visitor

Wrong total is 0.26 in third column, expected total is 1.47 is total of all the above values in the column and the formatted DAX is 

=

DIVIDE

CALCULATE

SUM

'SFDC Won

2851(orders)' [Total Sales Price (converted)] ),

FILTER (

'SFDC Won

'SFDC Won

IN

{

2851 (orders)'

2851(orders)'[New Product line Assignement]

"Asset Performance

Management"

CALCULATE

SUM

*SFDC Won 2851(orders)' [Total Sales Price (converted)] ),

FILTER

'SFDC Won

'SFDC Won

2851 (orders)'

2851(orders)' [New Product line Assignement]

IN {

"Asset Performance Management"

"Ellipse"

"LinkOne"

"Axis"

"Service Suite"

"eSOMS"

"Lumada (EAM & FSM)"

"Asset Suite"

}),0)

IMG_6423.jpeg

sergej_og
Super User
Super User

@Unknown1996 
I think you should provide bit better description while asking for help from all these guys.
Insert your DAX in a readable matter, not plain text.
What is your "wrong" total and what result do you expect?

Unknown1996
Regular Visitor

Unknown1996
Regular Visitor

@sergej_og @can you help me now 

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.