Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
admin_xlsior
Post Prodigy
Post Prodigy

Visual filter using TOP N

Hi guys,

 

Need advice how to use TOP N feature in Visual level filters. 

If lets say I have this kind of data :

Customer Group   CustomerSales Amount
Group AA00112
Group AA00277
Group AA00368
Group AA00435
Group BB00111
Group BB00216
Group BB00371
Group BB00437
Group BB00593
Group CC00116
Group CC00281
Group CC00386
Group CC00453

 

If we calculate manually, the total per Customer group, we get :

Group A Total192
Group B Total228
Group C Total236

 

So in Power BI, with the original data, I'm using Funnel visual to display Top 2 of it, but I need to put the Customer Group then Customer it self (in its setting - Group)

image.png

 

The question is how to set the TOP 2 in each of the group (TOP 2 Customer group and TOP 2 Customer). If I'm setting Visual filter - Customer Group with TOP N and set to 2, after I drill down to the Customers, obviusly the Customers will not display TOP 2 only but more than that. And if I put filter on both Customer Group and Customers, the setting will give me some warning and the input field is disabled, like this :

image.png

 

Can we set both as TOP 2 ?

Based on the original data, I would like my Funnel visual to show like this :

TOP 2 Group

Top 2 Customer GroupSales Amount
Group C236
Group B228

 

 

TOP 2 Customers

Top 2 CustomerSales Amount
Customer B00593
Customer C00386

 

Thanks,

 

 

 

 

 

 

 

 

 

 

 

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @admin_xlsior ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.

 

Best Regards,

Xue

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-xuding-msft
Community Support
Community Support

Hi @admin_xlsior ,

For a workaround, you could create a measure to get top 2 of customers.

 

Sum Sales Amount = CALCULATE(SUM('Table'[Sales Amount]),ALLEXCEPT('Table','Table'[Customer Group   ]))

TOP2 Customers = CALCULATE(MAX('Table'[Customer]),TOPN(2,ALLEXCEPT('Table','Table'[Customer Group   ],'Table'[Customer]),'Table'[Sales Amount],DESC))

3.PNG

Best Regards,

Xue

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
admin_xlsior
Post Prodigy
Post Prodigy

Hi, Thanks, but if I combine Customer group + Customer then TOP 2 based on Sales Amount, it will be the same as TOP 2 of customers, am I right ? 

 

There 2 different result on my original data, By Group, the no 1 is Group C, whilst By Customer, no.1 is B005  (which is belong to Group B)

 

Thanks,

 

 

Gordonlilj
Solution Sage
Solution Sage

Hi,

 

You could try and create a calculated column that combines group name and customer like this for example.

 

CalculatedColumn = 'Table'[Customer Group] & " " & 'Table'[Customer]

Then use the new column just as an extra visual filter and not in the actual visualisation

 

Capture.PNG

 

Doing this gives me the correct result based on the data and example you provided

 

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.