Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.