DAX Running Total & Running Total Percentages of 2 different products by months

srehman

Board Regular
Joined
Jan 4, 2020
Messages
210
Office Version
  1. 2016
Platform
  1. Windows
Hi Team,

I have performed running total and running total percentages in pivot table work perfect.
Now i am moving in DAX Power Bi , i am new as well.
I have calculate running total of one product but for 2 products all goes wrong. I am doing some mistakes.


A very clear example in attached snapshot.

Following data i am using , I need results as in snap shot.
!Karcher ABC AnalysisV3-Completed.xlsb
EFG
11SKUMonth-YYYYTotal Orders
1215163160April-20207
1315163160February-2020442
1415163160January-2020545
1515163160July-2020234
1615163160June-2020912
1715163160March-2020488
1815163160May-20206
1915131420April-2020111
2015131420February-2020336
2115131420January-2020488
2215131420July-2020480
2315131420June-2020157
2415131420March-2020310
2515131420May-2020199
2662958900April-2020218
Sheet4
 

Attachments

  • RT by Pivot Table need in DAX.PNG
    RT by Pivot Table need in DAX.PNG
    36.1 KB · Views: 19

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi,

need to understand your context.
The screenshot shows a running total just on orders in the table regardless of the accompanied month:
Example:
line19: SKU 15131420 has 111 orders in April
line20: SKU 15131420 has 336 orders in February
line21: SKU 15131420 has 488 orders in January

Your screenshot shows a running total of 447 orders in February however your request is a running total by month should the running total by month be (orders in January [488] + orders in February [336]) = 824 Orders or do you want a running total per line regardless of the month mentioned on that line?
 
Upvote 0
Additional to above:
See if this helps:

Be aware as i'm using a european version perhaps ; should be , in your version.
1597741862259.png
 
Upvote 0
Hi,

need to understand your context.
The screenshot shows a running total just on orders in the table regardless of the accompanied month: -->(Yes)
Example:--> ( yes these all orders per month for this product)
line19: SKU 15131420 has 111 orders in April
line20: SKU 15131420 has 336 orders in February
line21: SKU 15131420 has 488 orders in January

--> Yes You are right by line but i want running total percentage separate of each SKU as on last column of snapshot.
Your screenshot shows a running total of 447 orders in February however your request is a running total by month should the running total by month be (orders in January [488] + orders in February [336]) = 824 Orders or do you want a running total per line regardless of the month mentioned on that line?

If you found my answer helpful, please hit the Like button.

=====================================================

I tried to achieved by following formula.

sum CT = SUM(curbalGroup[Total Orders])

Sum of EachSKU = CALCULATE([sum CT],FILTER(curbalGroup,curbalGroup[SKU]))

Div by Tot Qty = DIVIDE([Sum of EachSKU],CALCULATE([Sum of EachSKU],ALL(curbalGroup)))

Div by SKU categ = DIVIDE([Sum of EachSKU],CALCULATE([Sum of EachSKU],ALLSELECTED(),VALUES(curbalGroup[SKU])))
 
Upvote 0
I am trying your approach i am new i got this attached result in 2 days my learning and implementation together.

I am not sure am i using right techniques or formula or method to drive results.

I will try by your Running Total and will let you know.

Thanks again for lot of support and time.
 

Attachments

  • DAX Result achieved.PNG
    DAX Result achieved.PNG
    25.9 KB · Views: 14
Upvote 0
I have tried by using your approach for Running total and results not matching.

RT MrEx = CALCULATE(sum(curbalGroup[Total Orders]),FILTER(ALL(curbalGroup),curbalGroup[Month-YYYY]<= max(curbalGroup[Month-YYYY])),VALUES(curbalGroup[SKU]))

I forgot tell you in snapshot DAX Running total i calculated in Power Query because i was not getting expected result by using DAX.

But i really want to do it by DAX.

Please check snapshot
 

Attachments

  • Compare Pivot & DAX results.PNG
    Compare Pivot & DAX results.PNG
    241.8 KB · Views: 16
Upvote 0
Your answer still confuses me because you don't answer the question.
The part showing Power BI has no selection or Sort within, it's just a table.
The part showing the pivot has the error of calculating a running total wrongly because the data is sorted on period.

Perhaps better to start a new thread in which you're asking the full question because you're only asking bits and pieces which needs amending to your situation.

Please read the guidelines for using the board and they will help you with a correct way of asking the question.
 
Upvote 0
Thanks for your help i was watching Excelfun different videos on above issue.
What i learned today when 1 door is closed 10 more different doors will open if you are truly try to learn.
Thanks again i will watch it.
 
Upvote 0

Forum statistics

Threads
1,223,750
Messages
6,174,290
Members
452,554
Latest member
Louis1225

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top