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
Anonymous
Not applicable

show top N/others with subcategories

I'm creating a top 20 / others table.

my rank measure is:
rank vendas loja = RANKX(all(d_loja[nm_loja]),[Total Vendido])

pic1.png

when I open subcategorie the rank "update"...
pic2.png


I only can show 5 stores per page (because I need export to power point), so I will filter top 1-5 on first page, 6-10 on second...
That's the result after my filter "top2", every rank is on position 1...

 

pic3.png

 



Using Tableau we have the "fixed" function, can we use something on PowerBI?
I'm doing something wrong?

my dataset

https://www.dropbox.com/sh/fjqpjzi8w8jp8jq/AAAUyXIFU3ILfuCQpAOXYwUOa?dl=0

1 ACCEPTED SOLUTION

@Anonymous,

Create another measure that ranks only by nm_loja using the DAX below.

Measure = RANKX(ALL('Table'[nm_loja]), Calculate(SUM('Table'[total]),ALLEXCEPT('Table','Table'[nm_loja])),,DESC,Skip)



Regards,
Lydia

Community Support Team _ Lydia Zhang
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

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@Anonymous,

Create a new table using DAX below.

Table = SUMMARIZE(f_vendas,d_loja[nm_loja],d_categoria[nm_categoria],"total",SUM(f_vendas[vl_quantidade]))

Then create a measure in the new table and check if it returns your expected result. If not, please post your desired result here.

Rank = RANKX(ALL('Table'[nm_categoria],'Table'[nm_loja]), Calculate(SUM('Table'[total]),ALLEXCEPT('Table','Table'[nm_categoria],'Table'[nm_loja])),,DESC,Skip)

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

you got very close!!

 

But that rank "ignore" the first group (nm_loja) and only rank the second (nm_categoria)

 

 

 

picRes.png       picRes02.png

 

Can we create another measure who ranks only by nm_loja?

 

@Anonymous,

Create another measure that ranks only by nm_loja using the DAX below.

Measure = RANKX(ALL('Table'[nm_loja]), Calculate(SUM('Table'[total]),ALLEXCEPT('Table','Table'[nm_loja])),,DESC,Skip)



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.