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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
o59393
Post Prodigy
Post Prodigy

Pareto not working

Hi all

I have the following table:

 

o59393_0-1714371023229.png

 

 

The pareto should sum the column % of dedicated time to look cumulative like this:

 

o59393_1-1714371137926.png

 

The measure used is:

 

Pareto = 

VAR demand = [Non Duplicate Hours Process/Activity 3]

RETURN

SUMX(
FILTER(
SUMMARIZE(ALLSELECTED(Template),'Template'[Merged.4],Template[Facet],
"Percentage", [Non Duplicate Hours Process/Activity 3]),
[Percentage] >= demand),
[Percentage]
)
        

Where Merged.4 is the combination of Function & Tier 1: Process & Tier 2: Activity

 

How can I get the percentages correct?

 

Thanks.

 

2 ACCEPTED SOLUTIONS
v-kongfanf-msft
Community Support
Community Support

Hi @o59393 ,

 

You should create index column in power query. Then try formula like below:

pareto =
VAR cur_ = 'Table'[Name]
VAR cur_index = 'Table'[Index]
RETURN
    SUMX (
        FILTER ( ALL ( 'Table' ), 'Table'[Name] = cur_ && 'Table'[Index] <= cur_index ),
        [TotalPercentage]
    )

vkongfanfmsft_0-1714444511553.png

Best Regards,
Adamk Kong

 

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

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached PBI file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

13 REPLIES 13
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached PBI file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur 

 

Just one question, when I have %'s with identical values, the Pareto and the Index function I created are not calculating correctly:

 

o59393_2-1716830302773.png

 

For instance, all the 5.15% values have the same index value of 2 and the pareto column doesnt sum correctly.

 

The formulas are:

 

Index = 
 RANK (
     DENSE,
     ALLSELECTED ( 
        Template[Facet],
        Template[Function],
        Template[Tier 1: Process Facet],
        Template[Tier 2: Activity Facet]
      ),
     ORDERBY ( [Non Duplicate Hours Process/Activity 3], DESC )
 )

 

RANK = 

if(HASONEFILTER(
    
    'Template'[Facet]),
    
    calculate(
        
        RANKX(
            
            GENERATE(
                
                GENERATE(
                    
                    ALLSELECTED('Template'[Tier 1: Process Facet]),
                    
                    ALLSELECTED('Template'[Tier 2: Activity Facet])),
                    
                    ALLSELECTED('Template'[Facet])),
                    
                    [Non Duplicate Hours Process/Activity Numerator],,DESC)),
                    
                    BLANK())

 

 

Running % = 

DIVIDE([Running total],

CALCULATE([Non Duplicate Hours Process/Activity Numerator],

ALLEXCEPT(Template,Template[Function],Template[Area])))

 

Running total = 

SUMX(TOPN(
    
    [Rank],
    
    CALCULATETABLE(
        
        GENERATE(GENERATE(values(
            
            'Template'[Facet]),
            
            values(
                
                'Template'[Tier 1: Process Facet])),

                values('Template'[Tier 2: Activity Facet])),
                
                GENERATE(
                    GENERATE(ALLSELECTED(
                        
                        'Template'[Facet]),
                
                ALLSELECTED('Template'[Tier 1: Process Facet])),
                
                ALLSELECTED('Template'[Tier 2: Activity Facet]))),
                
                [Non Duplicate Hours Process/Activity Numerator]),
                
                [Non Duplicate Hours Process/Activity Numerator])

 

Any idea how to fix this?

 

Thanks.

Hi,

Share some dummy data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur 

 

Please see attached a pbix sample: https://drive.google.com/file/d/1rID6tbIhYqanx6gcQnDaLESnn3eZr3vQ/view?usp=sharing

 

You will see repeated index (8 and 10 for example) where they have the same % value 3.51% and 2.51% respectively. 

 

o59393_0-1716911203823.png

 

 

The desired outcome (in green columns) would be to have the Running % column making the cumulative sum in each row.:

 

o59393_1-1716911203535.png

 

 

Thanks.

 

Hi,

Modify your rank measure to

RANK(DENSE,SUMMARIZE(generate(generate(ALLSELECTED('Template'[Tier 1: Process Facet]),ALLSELECTED('Template'[Tier 2: Activity Facet])),ALLSELECTED('Template'[Facet])),Template[Facet],Template[Tier 1: Process Facet],Template[Tier 2: Activity Facet]),ORDERBY([Non Duplicate Hours Process/Activity Numerator],DESC,Template[Tier 1: Process Facet],ASC,Template[Tier 2: Activity Facet],ASC))

This will assign a different number to each row.  Now carefully review your others measures to get them working.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur 

 

I modified the rank but stills doesnt show the right value on the Running % column:

o59393_0-1716957409108.png

 

 

Also, how could I have the index formula display 1,2,3 without repeating values or blanks?

 

Thanks.

As i mentioned, i have got the correct rank for you (different numbers).  Review and revise the other measures yourself to get your desired result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

My bad @Ashish_Mathur 

 

Rank works perfect:

 

o59393_1-1716957814225.png

 

 

The only issue is with the Runnng %.

 

Using your formula I still not get the right cumulative sum:

 

Running % = 

DIVIDE([Running total],

CALCULATE([Non Duplicate Hours Process/Activity Numerator],

ALLEXCEPT(Template,Template[Function],Template[Area])))

 

 

Running total = 

SUMX(TOPN(
    
    [Rank],
    
    CALCULATETABLE(
        
        GENERATE(GENERATE(values(
            
            'Template'[Facet]),
            
            values(
                
                'Template'[Tier 1: Process Facet])),

                values('Template'[Tier 2: Activity Facet])),
                
                GENERATE(
                    GENERATE(ALLSELECTED(
                        
                        'Template'[Facet]),
                
                ALLSELECTED('Template'[Tier 1: Process Facet])),
                
                ALLSELECTED('Template'[Tier 2: Activity Facet]))),
                
                [Non Duplicate Hours Process/Activity Numerator]),
                
                [Non Duplicate Hours Process/Activity Numerator])

 

Any idea on why this happens?

 

Thanks.

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1717033120199.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur perfect!

 

Thanks.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-kongfanf-msft
Community Support
Community Support

Hi @o59393 ,

 

You should create index column in power query. Then try formula like below:

pareto =
VAR cur_ = 'Table'[Name]
VAR cur_index = 'Table'[Index]
RETURN
    SUMX (
        FILTER ( ALL ( 'Table' ), 'Table'[Name] = cur_ && 'Table'[Index] <= cur_index ),
        [TotalPercentage]
    )

vkongfanfmsft_0-1714444511553.png

Best Regards,
Adamk Kong

 

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

 

Hi @v-kongfanf-msft 

 

I see you did a calculated column. How can it be done with a measure?


Thanks.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.