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

Dynamic Top10 list

Hi community

 

I am having a problem and i can't seem to find an answer.

 

I have a dataset with the following columns:

 

Customer, Region, Department, Salesman, Sales last year, Sales this year

 

The user need to be able to filter on: Region, Department, Salesman

 

The result i want is a top10 list of best customers which fit the criteria. For example if they choose the region: "Jylland", and Salesman "Karl", it should give me the 10 best customers in "Jylland" with "Karl". If i choose "Karl" and "Erik" as salesman, i want it to give me the top ten between them.

 

The measure i have tried is this:

 

Stor Top10 =
Var  Rep = VALUES(Kundetabel[Salesman])
Var  Kunde = VALUES(Kundetabel[Customer])
Var  Afdeling = VALUES(Kundetabel[Department])
Var Region = VALUES(Kundetabel[Region)
 
Return
CALCULATE([Sales];
TOPN(10;
CALCULATETABLE(FILTER(all(Kundetabel);
Kundetabel[Department] in Afdeling &&
Kundetabel[Oms År] > 0 )
)
;[Sales)
;Region;Department;Salesman;Customer
)

 
This gives me a top ten for each department i choose, and i cannot get it to accept more Variables in my calculatetable.
 
I have also tried with a RANKX:
 
PotRank =
RANKX(
ALLSELECTED(Kundetabel)
;[Sales];;ASC;Skip)

 

combined with another RANKX

Salg Top10
Var Plads = [PotRank]

return
CALCULATE([Sales];
FILTER(Kundetabel;
Plads<=10))

 

Which gives me the right result, but i cannot remove the blanks in it.

 

2 REPLIES 2
vivran22
Community Champion
Community Champion

Hey @ChristianHE ,

 

Will visual level filter solve your purpose?

 

image.png

 

You can use multiple slicer/filters

 

Cheers!
Vivek

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Hi,

You can try;

If (___yourrankmeasure <= 10 , ___yourankmeasure , blank() )

 

Kind regards Steve

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