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

Pareto with SUMX Function resulting in cumulative sum with duplicate values

Hello all, 

 

I am brand new to PowerBI and I'm making a pareto chart to show defect count. I'm having an issue whenever there are two or more defects with the same amount of occurrences.  For example, when I use the summarize function to create a table of counts and then use SUMX to get the sum, the below table would appear : 

DefectCount of Defect OccurenceCumulative SumIdeal Sum (what it should be)
A666
B41410
C41414

This creates a flat line on the pareto wherever there are duplicate values even though it should be curved (I have pasted an example of my code and pasted the image of what I am getting below).

 

 

I have tried numerous solutions to this including trying to use RANKX and conditional statements but I can't seem to get anything to work.  I have spent so many more hours on this than I originally planned, please any help would be super appreciated!!

2021-08-31_16-42-58.png

 

Defect Cumulative Percent = 
VAR deftotal = CALCULATE(COUNT(Sheet1[Defect]),ALLSELECTED(Sheet1[Defect]))
VAR subcount = COUNT(Sheet1[Defect])
VAR Counttable = 
FILTER(
    SUMMARIZE(
        ALLSELECTED(Sheet1[Defect]),
        Sheet1[Defect],
        "Defect Count", Count(Sheet1[Defect])),
        Sheet1[Defect] <> Blank()
)
VAR Cumulativesum = 
SUMX(
    FILTER(Counttable, [Defect Count] >= SUBCOUNT),
    [Defect Count]
)
RETURN
Cumulativesum/deftotal

 

 Thanks,
Sam

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

you can rank defect to solve this problem. I did the similar test before. pls see the attachment below

1.PNG





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@Anonymous 

you can rank defect to solve this problem. I did the similar test before. pls see the attachment below

1.PNG





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

Proud to be a Super User!




Anonymous
Not applicable

Thank you! I was finally able to get this to work!  I only had to make an adjustment to your code where you created the secondary rank based off of the ID column.  Due to the name of my defects being varied the rank was returning incorrect values, instead I had it refer to a numerical ID column (similar to an index column) that was already in my table and used that as the secondary rank reference.

 

Finished product: 

ussaste2_0-1630509601444.png

 

Hi @Anonymous 

can you tell me more like what all changes have u done and the modified measure.

 

Quick response would be appreciated.

I have also written the same measure but stucked at duplicate values getting same cumulative percentage

 

Defect Cumulative Percent = 
VAR deftotal = CALCULATE(COUNT(Sheet1[Defect]),ALLSELECTED(Sheet1[Defect]))
VAR subcount = COUNT(Sheet1[Defect])
VAR Counttable = 
FILTER(
    SUMMARIZE(
        ALLSELECTED(Sheet1[Defect]),
        Sheet1[Defect],
        "Defect Count", Count(Sheet1[Defect])),
        Sheet1[Defect] <> Blank()
)
VAR Cumulativesum = 
SUMX(
    FILTER(Counttable, [Defect Count] >= SUBCOUNT),
    [Defect Count]
)
RETURN
Cumulativesum/deftotal

 

you are welcome





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

Proud to be a Super User!




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.