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

Top N showing positive & negative together

Hi all, 

 

I know this question has been asked loads but I can't seem to find a solution that works for me.

 

I have done some reading into this and tried several things such as ABS and RANX (information in links below)

 

ABS function:  https://docs.microsoft.com/en-us/dax/abs-function-dax

RANKX function: https://docs.microsoft.com/en-us/dax/rankx-function-dax

 

I then stumbled across this thread:

 

https://community.powerbi.com/t5/Desktop/Sort-Rows-by-Positive-and-Negative/m-p/595886#M283022

 

This worked wonders and I started to get somewhere with what I wanted but I then hit another roadblock detailed below.

 

I have an issue where my Matrix table is grouping ID's together and therefore the value of these ID's meaning I am getting distorted values and even some columns with a zero value (where a transaction has come in and gone out therefore leaving a zero value).

 

Is there a way to stop it grouping like this (a bit like your picture) as again my Top N goes from positive all the way down to negative and not jumbled up (like your picture).

 

Basically what I'm trying to achieve is the Top N based on value whether or not it is a positive or negative

 

Example of my matrix table data

 

ID        Name           Qty           Value

1245    T-Shirt           5              £50

1287    Top                20           £60

1245    T-Shirt           -5           -£50

2567    Boots             -30         -£200

6947    Socks             200         £100

 

 

Current Matrix table:

 

ID          Name          Qty          Value

6947      Socks          200           £100

1287      Top             20             £60

1245      T-Shirt        0               £0              <<Grouped together but because it's a 0 value I don't want it to show in my Top N table

2567      Boots          -30           -£200

 

I want my table to look like this:

 

ID          Name          Qty          Value

6947      Socks          200           £100

2567      Boots          -30           -£200

1267      Top              60            £60

 

Any help would be fantastic

Thank you!

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

I'm not so clear for your dax formulas, can you please share some test data with sample formula for test?

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.