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, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Reddy567
Regular Visitor

Top N filter not working along with other measure filter.

I have to filter Count(Orderid)>50 and then display Top 10 Products based on Total Sales Amount Desc. 

 

I have created Measure for count(Orderid) and applied filter Measure>50 and Applied visual lever Top 10 filter on Product based on Total Sales amount.

 

But first Top N filter is applying and later Measure>50 filter is getting applied. Can we change this order to apply Measure>50 first and later Top N filter?

1 ACCEPTED SOLUTION
nsexton12
Resolver II
Resolver II

You could create another measure that filters out all products where count <  50, and put that in the filter for your TOPN calculation as well as the table. This will ensure that no values less than 50 will ever reach the TOPN filter.

 

For example: 

 IF(COUNT(Table[OrderId]) < 50, 0, SUM(Table1[Sales]))

If this works for you, please mark as a solution!

View solution in original post

3 REPLIES 3
v-kongfanf-msft
Community Support
Community Support

Hi @Reddy567 ,

 

Try formula like below:

 

result_ = 
CALCULATE (
    MAX ( 'Count'[Value] ),
    KEEPFILTERS (
        TOPN ( 3, FILTER ( ALL ( 'Count' ), 'Count'[Orderid] > 50 ), 'Count'[Value] )
    )
)

 

vkongfanfmsft_1-1708584178762.png

 

Best Regards,
Adamk Kong

 

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

nsexton12
Resolver II
Resolver II

You could create another measure that filters out all products where count <  50, and put that in the filter for your TOPN calculation as well as the table. This will ensure that no values less than 50 will ever reach the TOPN filter.

 

For example: 

 IF(COUNT(Table[OrderId]) < 50, 0, SUM(Table1[Sales]))

If this works for you, please mark as a solution!

Thanks a lot @nsexton12 . It worked. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.