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
Rahul109
New Member

Category based Cumulative total and ABC segmentation

Hi guys, I need to create a measure that calculates cumulative total and then put them into ABC category.

 

Category- Country and material number are the column coming from Product Dimention table and TO 3M is coming from Finance table. I need to arrange the material number into Desc order on the basis of TO 3M but it should be grouped by Category-Country. For example if you see row 10 of table , material no 281's TO is highest in the DEODORANT & FRAGRANCE_Nepal but not for other category.

 

After that, In column - % of parent row total, we are calculating % of material number turn over with respect to its parent category-country turnover total same as we do in excel pivot table.

Then i need to calculate Cumulative total which is of material number belonging to same category-country field.

 

I need to do this all on measure level because the calculation id dynamic. you can consider this as 1 month data and for that month the turnover is this and when the customer changes the month all this will also change.

 

This is the Input table which is not in desired order. Sorting should be done in material number based on TO 3M  inside the category-Country. Different category-Country can be arranged in any order.

 

Category - CountryMaterial NumberSum of TO 3M
DEODORANT & FRAGRANCE_India121202289
DEODORANT & FRAGRANCE_India101121921
DEODORANT & FRAGRANCE_Bhutan17123955
DEODORANT & FRAGRANCE_Bhutan98122866
DEODORANT & FRAGRANCE_Bhutan2197119
DEODORANT & FRAGRANCE_Bhutan54196482
DEODORANT & FRAGRANCE_India98767414
DEODORANT & FRAGRANCE_India23466881
DEODORANT & FRAGRANCE_Nepal100304891
DEODORANT & FRAGRANCE_Nepal177290550
DEODORANT & FRAGRANCE_India45197020
DEODORANT & FRAGRANCE_India39787978
DEODORANT & FRAGRANCE_India1283662
DEODORANT & FRAGRANCE_India9968147
DEODORANT & FRAGRANCE_Nepal401134558
DEODORANT & FRAGRANCE_Bhutan51222082
DEODORANT & FRAGRANCE_Bhutan23145511
DEODORANT & FRAGRANCE_Bhutan500135259
DEODORANT & FRAGRANCE_Nepal86287092
DEODORANT & FRAGRANCE_Nepal59199299
DEODORANT & FRAGRANCE_Nepal361182553
DEODORANT & FRAGRANCE_Nepal381156836

 

For ABC bucket , logic is 

A0%A
B80%B
C95%C
D99%D

 Please can some one help on this.

 

 

 

output file : 

Category - CountryMaterial NumberSum of TO 3MSum of TO 3M2CumulativeABC Bucket
DEODORANT & FRAGRANCE_India12120228925.44%25.44%A
DEODORANT & FRAGRANCE_India10112192115.33%40.77%A
DEODORANT & FRAGRANCE_India451970208.48%49.24%A
DEODORANT & FRAGRANCE_India3978797811.06%60.30%A
DEODORANT & FRAGRANCE_India12836628.57%68.87%A
DEODORANT & FRAGRANCE_India996814712.20%81.07%B
DEODORANT & FRAGRANCE_India987674148.41%89.48%B
DEODORANT & FRAGRANCE_India2346688110.52%100.00%D
DEODORANT & FRAGRANCE_Nepal10030489119.60%19.60%A
DEODORANT & FRAGRANCE_Nepal17729055018.68%38.27%A
DEODORANT & FRAGRANCE_Nepal8628709218.45%56.73%A
DEODORANT & FRAGRANCE_Nepal5919929912.81%69.54%A
DEODORANT & FRAGRANCE_Nepal36118255311.73%81.27%B
DEODORANT & FRAGRANCE_Nepal38115683610.08%91.35%B
DEODORANT & FRAGRANCE_Nepal4011345588.65%100.00%D
DEODORANT & FRAGRANCE_Bhutan5122208223.54%23.54%A
DEODORANT & FRAGRANCE_Bhutan2314551115.43%38.97%A
DEODORANT & FRAGRANCE_Bhutan50013525914.34%53.31%A
DEODORANT & FRAGRANCE_Bhutan1712395513.14%66.45%A
DEODORANT & FRAGRANCE_Bhutan9812286613.03%79.48%A
DEODORANT & FRAGRANCE_Bhutan219711910.30%89.77%B
DEODORANT & FRAGRANCE_Bhutan5419648210.23%100.00%D
1 ACCEPTED SOLUTION

Hi, @Rahul109 

Thank you for your feedback.

Please check the below picture and the link down below.

 

Picture1.png

 

 

https://www.dropbox.com/s/l8adu2ppqjvkvmk/rahul.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

Hi, @Rahul109 

I am not sure how your desired outcome looks like, but please check the below picture and the sample pbix file's link down below.

I suggest having a grouping table like below.

 

All measures are in the sample pbix file, and all steps are numbered in front of each measure.

 

Picture1.png

 

 

https://www.dropbox.com/s/l8adu2ppqjvkvmk/rahul.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi, @Jihwan_Kim thank you for replying.

 

i have updated the question please go through it. Actually i need to sort the data first then i need a measure which performs all the calculation from column 4 to 6 then give column 6 as an output. 

Hi, @Rahul109 

Thank you for your feedback.

Please check the below picture and the link down below.

 

Picture1.png

 

 

https://www.dropbox.com/s/l8adu2ppqjvkvmk/rahul.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi @Jihwan_Kim I have updated the sample dataset. In earlier data set Material codes were in Desc order but in my real data set they are not. Your logic for calculating Cumulative total, Percentage and ABC Bucket is perfect but the only thing i need to perform  before calculating the rest is sorting the Turn over in DESC order WRT to category - Country field 

Currenty i am facing this issue , the measure logic is sorting the turnover value among all the TO values irrespective of the Category - Country field. 

Rahul109_0-1622383858369.png

 

I would be highly grateful if you could refer to the Lastest data set and Share the solution.

 

Hi, @Rahul109 

Thank you for your feedback.

I am not sure if I understood your question correctly, but I think the cumulative total is based on the category. I think the number is showing correctly.

Or, please let me know how your desired outcome looks like.

Thanks.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hello @Jihwan_Kim , I have checked again properly and Found out that cumulative total is coming correct.  Thank you for your help. 😃

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.