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
oscarr29
Helper I
Helper I

how to use PowerBi filter top 10 negative number

anyone know how to use PowerBi to filter Top 10 Top 5 Top 3 negative number?

example: 
kent -2000
jack -3000
kiki 2000
yuki -1000
yoyo 3000

i want result:
Jack -3000
kent -2000
yuki -1000

Untitled.jpgUntitled1.jpg

6 REPLIES 6
jthomson
Solution Sage
Solution Sage

TOPN has an option to sort ascending or descending

already tried TOPN, cannot ascending or descending, and that way is very troublesome...

actually i want like this,  https://www.youtube.com/watch?v=SsZseKOgrWQ&feature=youtu.be

but this one no teach how to filter negative number, and i'm tried got some error there.Untitled2.jpg

@oscarr29

 

Hi, Try with this method:

 

Create a Table with:

 

Tops1.png

 

Create a measure to Rank:

 

Ranking =
RANKX ( ALLSELECTED ( Table1 ); CALCULATE ( SUM ( Table1[Profit] ) );; ASC )

Create another measure to include or exclude in the visual:

 

InTop =
VAR TOPSELECTED =
    SELECTEDVALUE ( Tops[Top] )
RETURN
    IF ( [Ranking] <= TOPSELECTED; "INCLUDE"; "EXCLUDE" )

 

Alternative 1

 

And in the Visual LeveL Filter

 

Tops2.png

 

Alternative 2

 

In your Profit Measure add this:

 

ProfitM =
IF ( [InTop] = "INCLUDE"; SUM ( Table1[Profit] ); BLANK () )

Ready.

 

Regards

 

Victor

Lima - Peru




Lima - Peru

Hi @Vvelarde

i use your formula got 1 problem, if i choose filter top 3 client, there will filter negative and positive value...

i want that results is separate top 3 negative value client and top 3 positive  value client...can make that negative and positive button to choose ?Untitled4.jpgUntitled5.jpgUntitled6.jpg

 @oscarr29

 

Review this PBIX File, this give you a path to solve your problem.

 

LINK

 

Regards

 

Victor




Lima - Peru

Hi @Vvelarde

 

Can you do a multi filter with top 10 client and negative or positive number ?

 

ThanksUntitled3.jpg

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.