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
Charmaine
Frequent Visitor

chart show only top N% (percentile chart)

Hi all,

 

I have a measure which is to calculate the productivity of operators, let say, productivity = sum(production)/sum(hour)

I would need a graph to show only operators with top 20% highest productivity. 

 

i have create another measure 

Top20% operators= calculate(productivity, filter(ProductionTable, productivity>percentilex.inc(ProductionTable, productivity, 0.8)))

but it doesnt work.

 

Please help!

 

 

1 ACCEPTED SOLUTION

Hi @Charmaine

 

You could modify the measure as below:

 

Top20% =
VAR highest =
    CALCULATE (
        MAXX (
            SUMMARIZE (
                'Production Table2',
                'Production Table2'[Operator],
                "Top20%", [Productivity1]
            ),
            [Top20%]
        ),
        ALLSELECTED ( 'Production Table2' )
    )
RETURN
    IF ( [Productivity1] > 0.8 * highest, [Productivity1] )

The test picture is below:

 

Capture.PNG

 

Hope it can help you!

 

Best regards,

Cherry

Community Support Team _ Cherry Gao
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

5 REPLIES 5
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Charmaine

 

From your description, if I understand your requirement correctly, you want to get the operator with Top20% productivity.

 

By my test, your Dax expression may not get the result you expect. You could modify your dax expression as this below:

 

Top20% Productivity =
VAR highest =
    CALCULATE (
        MAXX (
            SUMMARIZE (
                'Production Table',
                'Production Table'[operator],
                "Top20%", [Productivity1]
            ),
            [Top20%]
        ),
        ALL ( 'Production Table' )
    )
RETURN
    IF ( [Productivity1] > 0.8 * highest, [Productivity1] )

For further details, you could refer to my pbix file.

 

Hope it can help you!

 

Best Regards,

Cherry  

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi Cherry, do you have any alternative if we do it another way round to show the top 20% operators only.

Hi @Charmaine

 

You could modify the measure as below:

 

Top20% =
VAR highest =
    CALCULATE (
        MAXX (
            SUMMARIZE (
                'Production Table2',
                'Production Table2'[Operator],
                "Top20%", [Productivity1]
            ),
            [Top20%]
        ),
        ALLSELECTED ( 'Production Table2' )
    )
RETURN
    IF ( [Productivity1] > 0.8 * highest, [Productivity1] )

The test picture is below:

 

Capture.PNG

 

Hope it can help you!

 

Best regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

what if instead of productivity I have a calculated measure, which goes row by row in my fact table?

 

I can´t seem to get it wright

 

regards

Hi Cherry @v-piga-msft, Thanks for your time. I have modified the set of data by adding a date column, and in my pbi i would have a date filter. 

 

WeChat Screenshot_20180224165902.png

but in some cases, there is no operator return. In my understanding, there should have at least one operator is in top 20% productivity in any situation?

WeChat Screenshot_20180224170439.png

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.