cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

TOP 10(20,50,100...) products

Hi all,
I have filter witch contain "invoices" and "POS".

And also I have 4000 records (2000 for invoices and 2000 for POS).

I want get TOP X products with my filter. below is my filter code.

Rank = RANKX(ALL('current year'),'current year'[UnitsSold],,DESC)
when i am choose invoices it's work right.
pic1.PNG
But when I am choose POS it's shows only one row, but need to be 10 row(top 10) .
pic2.PNG
How can I fix?
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: TOP 10(20,50,100...) products

Nothing was changed ;\ ... but everything is ok, I just changed my sql. now I have two datasets and can rank  individually.

View solution in original post

8 REPLIES 8
Highlighted
Super User IV
Super User IV

Re: TOP 10(20,50,100...) products

Hi @Vrto95 

Try the below

RANKX(
    ALL('current year'[UnitsSold]),
    'current year'[UnitsSold],,
    DESC,
    Dense
)

 

Regards,
Mariusz

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

Highlighted
Helper I
Helper I

Re: TOP 10(20,50,100...) products

@Mariusz , No it's doesn't work 😕

Highlighted
Resolver III
Resolver III

Re: TOP 10(20,50,100...) products

Please use this:

 

Rankm1 = IF(HASONEVALUE(current year[valuetype]),
RANKX(ALL('current year'),'current year'[UnitsSold],,DESC),
BLANK()
)
 
It would help you.
Highlighted
Helper I
Helper I

Re: TOP 10(20,50,100...) products

@hthota , it's not work ;\

Highlighted
Super User IV
Super User IV

Re: TOP 10(20,50,100...) products

Hi @Vrto95 

Try the below.

VAR tbl = CALCULATETABLE( VALUES( 'current year'[UnitsSold] ), ALLSELECTED() ) 
RETURN 
RANKX(
    tbl,
    'current year'[UnitsSold],,
    DESC,
    Dense
)

Regards,
Mariusz

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

Highlighted
Resolver III
Resolver III

Re: TOP 10(20,50,100...) products

Try this:

 

Rankm1 = IF(HASONEVALUE(current year[valuetype]),
RANKX(ALL('current year'),'current year'[UnitsSold]),
BLANK()
)
Highlighted
Resolver III
Resolver III

Re: TOP 10(20,50,100...) products

Try this:

 

Rankm1 = IF(HASONEVALUE('current year'[valuetype]),
RANKX(ALL('current year'),'current year'[UnitsSold]),
BLANK()
)
Highlighted
Helper I
Helper I

Re: TOP 10(20,50,100...) products

Nothing was changed ;\ ... but everything is ok, I just changed my sql. now I have two datasets and can rank  individually.

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors