cancel
Showing results for
Search instead for
Did you mean:
Anonymous
Not applicable

## Top 5 Variances DAX

Hey All,

How would I create a DAX formula to take the top 5 variance over OR under a threshold amount of \$12k?

Any help would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Top 5 Variances DAX

HI @Anonymous,

You can try to use following measure if it works for your scenario.

```Rank =
RANKX (
ALL ( Table ),
CALCULATE ( SUM ( Table[Variances] ), ALLEXCEPT ( Table, Table[Country] ) ),
,
ASC,
DENSE
)
```

If not help, please share a table with some sample data to test.

Regards,

Xiaoxin Sheng

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

For learning resources/Release notes, please visit: | |
4 REPLIES 4
Super User

## Re: Top 5 Variances DAX

Sample data and expected results would assist greatly.

### I have book! Learn Power BI from Packt

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Anonymous
Not applicable

## Re: Top 5 Variances DAX

@Greg_Deckler Here is the Variance and country column. (Attached)

Expected Results would Top 5 Var over sale's plan by Country:

1.France -12,050

2. USA - (12,050)

3. Germany - 50,000

4. Sweden - 75,000

5. Canada - (100,000)

Anonymous
Not applicable

## Re: Top 5 Variances DAX

Can anyone give some insight on this topic?

Community Support Team

## Re: Top 5 Variances DAX

HI @Anonymous,

You can try to use following measure if it works for your scenario.

```Rank =
RANKX (
ALL ( Table ),
CALCULATE ( SUM ( Table[Variances] ), ALLEXCEPT ( Table, Table[Country] ) ),
,
ASC,
DENSE
)
```

If not help, please share a table with some sample data to test.

Regards,

Xiaoxin Sheng

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

For learning resources/Release notes, please visit: | |

## Helpful resources

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 43 members 863 guests
Recent signins:
Please welcome our newest community members: