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

Top 5 percent filter

hello!

 

I am trying to show just Top 5 cp in a barchart and hide or do not show other values in the barchart.

cap1.PNG

Like that:

cap2.PNG

the problem here, i'm using this formula to calculate the percentage:

%cp = 

DIVIDE(SUM (table[volume]);CALCULATE(SUMX(filter( table; table[cp] <>"med" );table[volume] );ALL( table)))
and when i use the cp on filter, the percentage doesn't change
cap3.PNG
i rather wait for top 5 of this result:
cap4.PNG
 
Any help!
Thank you
5 REPLIES 5
Pragati11
Super User
Super User

Hi @Mery ,

 

In your "cp%" calculation, use ALLSELECTED rather then ALL.

 

Thanks.

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

The problem with ALLSELECTED, when i keep top 5 i have a 100% on the 5 cp.

VasTg
Memorable Member
Memorable Member

@Mery 

 

Try this..

 

 

 

%cp = 
VAR A = ALLSELECTED(TABLE[CP])
VAR B = CALCULATE(SUM(TABLE[volume]),FILTER(A,TABLE[cp]<>"med")) 
RETURN DIVIDE(SUM (table[volume]),B)

 

 

Let us know..

 

 

If it helps, mark it as a solution

Kudos are nice too 

Connect on LinkedIn
VasTg
Memorable Member
Memorable Member

@Mery 

 

In the new filter panel on the right side after you select the visual, select the attribute(arrow) and choose filter type as top N and 5. 

Drag the measure you used in the graph in "By Value"(highlighted) and Apply filter.

image.png

If it helps ,mark it as a solution

Kudos are nice too

Connect on LinkedIn
Mery
Frequent Visitor

my problem isn't how to display the top 5 but how calculate the percentage correctly in mode top 5 as explained on the post. 

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