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
smnfx
New Member

RANKX sum of articles sold by seller ID (group)

Hi all,

I feel stupid asking this, because it must be pretty easy to do.
I've checked multiple other similar cases I could find here and on google. Normally these help solve my issues, but somehow I am not able to get behind it myself...

 

Here goes:

 

I need to Rank the products sold by MA ID:

 

Table Name: 'SumArtikelMitarbeiter' (created from other tables with SUMMARIZE)

smnfx_0-1656944516262.png

 

So it ranks the sold articles (value in column: [SumVerkauft]) for every [MA ID] like it is in the screenshot.

For every MA ID the ranking starts from 1 to X, so I know which article was most sold and least sold by seller.

 

I've tried multiple suggestions, like:

Column = RANKX(ALL(SumArtikelMitarbeiter[MA ID]), [SumVerkauft])
 
I also tried with a SUM(SumArtikelMitarbeiter[SumVerkauft]) measure instead of the [SumVerkauft] row
 
or with ALLEXCEPT
 
but it's only showing 1s in every row.
 
Do you guys have a tip for me to have DAX rank the [SumVerkauft] grouped by [MA ID]?
 
I can also share the report, it's just to play around in and replicate "problems".
 
THANK YOU!
1 ACCEPTED SOLUTION
v-mengzhu-msft
Community Support
Community Support

Hi @smnfx ,

 

You can try this measure:

 

sort = rankx( summarize(filter(allselected('SumArtikelMitarbeiter'),[ma id]=selectedvalue('SumArtikelMitarbeiter'[ma id])),[ma id],[sumverkauft]),calculate(sum('SumArtikelMitarbeiter'[sumverkauft])))

 

Best regards,

Community Support Team Selina zhu

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

View solution in original post

4 REPLIES 4
v-mengzhu-msft
Community Support
Community Support

Hi @smnfx ,

 

You can try this measure:

 

sort = rankx( summarize(filter(allselected('SumArtikelMitarbeiter'),[ma id]=selectedvalue('SumArtikelMitarbeiter'[ma id])),[ma id],[sumverkauft]),calculate(sum('SumArtikelMitarbeiter'[sumverkauft])))

 

Best regards,

Community Support Team Selina zhu

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

smnfx
New Member

 

Hi @Jihwan_Kim !

 

Thank you for taking the time to have a look at my problem :).

 

Unfortunately, if I paste your code into a new column, it says it detected a circular dependancy:

smnfx_0-1657015514361.png

 

I can also try to describe my situation differently if it is unclear.

 

Thanks again!

 

Hi,

Thank you for your feedback.

Please try the below. 

 

Column =
RANKX (
    FILTER (
        SumArtikelMitarbeiter,
        SumArtikelMitarbeiter[MA ID] = EARLIER ( SumArtikelMitarbeiter[MA ID] )
    ),
     SumArtikelMitarbeiter[SumVerkauft]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly but could you please try the below?

It is for creating a new column.

 

 

Column =
RANKX (
    FILTER (
        SumArtikelMitarbeiter,
        SumArtikelMitarbeiter[MA ID] = EARLIER ( SumArtikelMitarbeiter[MA ID] )
    ),
    CALCULATE ( SUM ( SumArtikelMitarbeiter[SumVerkauft] ) )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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