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
Jo_Chrq
Helper I
Helper I

Column with line number in PBI table

Hello,

I did a report with a table that ranks several brands my company sells, based on each brand income.

I would like to add a first column with the line numbers (ranking).

Is there a way to do so?

 

Thanks in advance

Jo

1 ACCEPTED SOLUTION

Hi @Jo_Chrq ,

 

You can also try

RANK = RANKX(ALL('Table'[Regions   ],'Table'[Stores     ]),CALCULATE(SUM('Table'[Revenue  ])))

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

8 REPLIES 8

Hi @amitchandak 

Yes  believe that's it.

If you consider the following table, I have the columns "Stores" and "Revenue" and basically I need to add the Rank column :

Rank (column needed)StoresRevenue
1Store B100€
2Store C95€
3Store A75€

Hi @Jo_Chrq ,

 

Create these 2 measures

 

Total Sales = SUM('Table'[Revenue])

 

RANK = RANKX(ALL('Table'[Stores]), [Total Sales],,DESC)

 

1.jpg

 

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

Hi @harshnathani 

Thank you, I'm now getting really close but still have an issue.

The table actually has an extra column and the ranking I get is within these categories (btw I apologize for my poor English level ...)

Here's the result I get :

Rank  Regions   Stores     Revenue  

1

NorthStore B100€

2

NorthStore C95€
1SouthStore A75€
3NorthStore F60€
2SouthStore D55€

 

I would like to have the overall ranking, regardless the regions ...

 

Many thanks again

Hi @Jo_Chrq ,

 

RANK = RANKX(ALL('Table'),CALCULATE(SUM('Table'[Revenue  ])))

 

1.jpg

 

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Hi @Jo_Chrq ,

 

You can also try

RANK = RANKX(ALL('Table'[Regions   ],'Table'[Stores     ]),CALCULATE(SUM('Table'[Revenue  ])))

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Hi @harshnathani 

Yes it works perfectly! thanks

Jonathan

Pragati11
Super User
Super User

Hi @Jo_Chrq ,

 

Please share additonal details on your query. This is not helping at all.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.