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
Anonymous
Not applicable

Wrong Calculation at Grand Total

Hi Friends,

 

I have the following data in Power BI.

Jeevan2022_0-1653480579299.png

I have added new column to arrive Error column i.e., Fcst - Actuals.

Error calcualtion should happen at SKU & DC level i.e., for example SKU A has two customers and 1 DC.

Jeevan2022_1-1653480815503.png

One value is -450 and another one is 325 so final erros is -125 and convert this into +ve number ABS(-125).

I have written measure to show this calcualtion and showing perfect.

Jeevan2022_2-1653480954985.png

However, at the total level result is wrong. It is showing the difference of total columns Fcst & Actuals. 4825 - 6520 = 1695.

But the total i need here is the total of the ABS Erro New measure i.e. 3835.

My final result should like this.

Jeevan2022_3-1653481198564.png

Note: When i filter customer it should work accordingly.

 

Please help me on this here.

 

@Greg_Deckler @amitchandak @Ashish_Mathur @Jihwan_Kim @ChandeepChhabra 

 

 

 

1 ACCEPTED SOLUTION

@Anonymous 

Please create the following measure:

Error Measure = 
SUMX(
    SUMMARIZE( Table3, Table3[DC],Table3[SKU]),
    ABS( CALCULATE( SUM(Table3[Fest]) - SUM(Table3[Actuals (Ordered PGI)] ) ) )
)

 

Fowmy_0-1653504200706.png

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

8 REPLIES 8
Fowmy
Super User
Super User

@Anonymous 

Can you share the DAX calculation for "Abs Error New"?

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Hi @Fowmy ,

 

Here is the screenshot of the measure.

Jeevan2022_0-1653483940053.png

 

@Anonymous 

Please create the following measure:

Error Measure = 
SUMX(
    SUMMARIZE( Table3, Table3[DC],Table3[SKU]),
    ABS( CALCULATE( SUM(Table3[Fest]) - SUM(Table3[Actuals (Ordered PGI)] ) ) )
)

 

Fowmy_0-1653504200706.png

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

DoraRS
Frequent Visitor

What if we have "DC" and "SKU" coming from two different dim tables that are connected to fact sales table?

Hi @Fowmy ,
Your solution actually worked for me. 

Thanks.

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

Hi @Fowmy ,

 

Thank you so much it is working fine.

Greg_Deckler
Super User
Super User

@Anonymous This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

I also have a video on this topic:

https://youtu.be/n4TYhF2ARe8

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler ,

 

Thank you so much for the reply.

 

My case seems to be a little different becasue of converting negatives to postives. This is where i am stuck.

 

For instance, i have written the following measure to get the right total.

Jeevan2022_0-1653483633500.png

This gives me the correct grand total but at row level i am getting wrong answer.

Jeevan2022_1-1653483699926.png

SKU "A" and DC "DC1" ABS Erro should be 125 not 775.

In the actual table it is considering Error value of 325 & -450 as positive numbers and giving the total as 775. But mu requirement is do the calcualtion of 325+(-450) which gives me -125 then convert it into +125.

 

 

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.