Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Siti
Frequent Visitor

Cumulative Sum for the same values does not work. PS: I have no date and index field

Hi,

 

I want to achive cumulative percentage for pareto chart. I am able to calcaulate cumulative sum based on my Total Rejected numeric column. However, it is not working when the values are same in Total Rejected column and then of course my cummulative  % (Pareto Chart) does not return correct value. Below is the snap shot for the same.

 

Siti_1-1601550159775.png

Please help on this.

 

 

 

6 REPLIES 6
MFelix
Super User
Super User

Hi @Siti ,

 

What is the formula you are using for the rank and is it a measure or a column no your model?

 

You need to add a random value in order to not have duplicates and the calculation are correct.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Siti
Frequent Visitor

Hi, thank you for your response.

 

We have not used the rank for cumulative sum, it is just to show the duplicates values.  Below is the excerpt of cumulative logic. Appreciate your time and help.

PS: Cumulative is working fine except for duplicate values. Ranking and Indexing (New Parameter) both didn't work in this case.

 

VAR CurrentRejected = [Total Rejected]
VAR Summarizetable =
SUMMARIZE(
ALLSELECTED('FPY Rejected'),
'FPY Rejected'[Step],
"Rejected",COUNT('FPY Rejected'[PSID]))

VAR Cummulativesum =
SUMX(
FILTER(Summarizetable,[Rejected]>= CurrentRejected),
[Rejected]
)

 

 

Hi @Siti ,

 

I suggest you use RAND() Function to break ties in your rank column:

 

First you can create a rank measure :

 

Rank = RANKX(ALL('FPY Rejected'[Step]),[Total Rejected]+RAND(),,DENSE)

 

Then use the following measure for your Cummulativesum

 

VAR Currentrank = [Rank]
VAR Summarizetable =
SUMMARIZE(
ALLSELECTED('FPY Rejected'),
'FPY Rejected'[Step],
"Rejected",COUNT('FPY Rejected'[PSID]),"_rank",[Rank])

VAR Cummulativesum =
SUMX(
FILTER(Summarizetable,[_rank]>= Currentrank),
[Rejected]
)

Return Cummulativesum

 

For more details, please refer to https://www.youtube.com/watch?v=kRtmb8ftyQc

 

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

 

Best Regards,

Dedmon Dai

Thank you for your response. However, it is still not working. Below is the table for your reference.

 

StepRankTotal RejectedTestCummPareto Chart
POST_IESS_TEST181155661499.47%
TC20_FINAL_ASSEMBLY80155661499.47%
SAFETY_TEST_CFC85145662899.50%
SAFETY_TEST_ENCLOSURE85135664199.52%
LABEL_PRINTING_PRODUCT86125665399.54%
CO2_FFU_TEST89105669399.61%
KITTING90105669399.61%
OQC_(PACKING_INSPECTION)_BTO88105669399.61%
UPGRADE_LABEL88105669399.61%
TEST_WPU9195670299.63%
LABEL_PRINT9385672699.67%
PROCESSOR_PCA_TEST9285672699.67%
SPO2_FFU_TEST9385672699.67%
FUNCTION_TEST_NO_CHAMBER19875675499.72%
LABEL_PRINT_SHIPPING9675675499.72%

Hi @Siti ,

 

Would you please try the following rank meausre ?

 

Rank = RANKX(ALL('FPY Rejected'[Step]),[Total Rejected]+RANDBETWEEN(1,10000)/10000,,DENSE)

 

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

 

Best Regards,

Dedmon Dai

Hi @Siti ,

 

Would you please show us the whole sample data in pbix by onedrive for business?

 

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

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors