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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Noredlac86
Helper I
Helper I

Power BI Add rank or row number to column in a table chart

Hi Team.
I was wondering if you can help me with this issue. I have a table with car sellers.

CAR           Sell by
MAzda        Juan
Ford            Juan
Mazda2        Jhon

Therefore i create a table visualizations that show the top 5 sellers, its just a visual  and i count the column "SellBy"

Noredlac86_1-1676386837357.png

 

Noredlac86_2-1676386860890.png

 

But i want to add a new Column, with the order (Color Red), do you know how can i create this new column to show in the report.

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Noredlac86 ,

I created some data:

vyangliumsft_0-1676509620620.png

 

Here are the steps you can follow:

1. Modeling – New parameter -- Fields.

vyangliumsft_1-1676509620622.png

vyangliumsft_2-1676509620625.png

2. Create measure.

Count_Car =
COUNTX(
    FILTER(ALL('Table'),'Table'[Car]=MAX('Table'[Car])),[Sellby])
Count_Sellby =
COUNTX(
    FILTER(ALL('Table'),'Table'[Sellby]=MAX('Table'[Sellby])),[Sellby])
rank_car =
RANKX(
    ALLSELECTED('Table'),[Count_Car],,ASC,Dense)
rank_sellby =
RANKX(
    ALLSELECTED('Table'),[Count_Sellby],,ASC,Dense)
Top =
SWITCH(
    TRUE(),
    MAX('Parameter'[Parameter])="Car",[rank_car],
    MAX('Parameter'[Parameter])="Sellby",[rank_sellby])

3. Result:

When selecting Car, sort by car

vyangliumsft_3-1676509620627.png

When choosing Sellby, sort by Sellby

vyangliumsft_4-1676509620630.png

 

 

Best Regards,

Liu Yang

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

Hi  @Noredlac86 ,

I created some data:

vyangliumsft_0-1676509620620.png

 

Here are the steps you can follow:

1. Modeling – New parameter -- Fields.

vyangliumsft_1-1676509620622.png

vyangliumsft_2-1676509620625.png

2. Create measure.

Count_Car =
COUNTX(
    FILTER(ALL('Table'),'Table'[Car]=MAX('Table'[Car])),[Sellby])
Count_Sellby =
COUNTX(
    FILTER(ALL('Table'),'Table'[Sellby]=MAX('Table'[Sellby])),[Sellby])
rank_car =
RANKX(
    ALLSELECTED('Table'),[Count_Car],,ASC,Dense)
rank_sellby =
RANKX(
    ALLSELECTED('Table'),[Count_Sellby],,ASC,Dense)
Top =
SWITCH(
    TRUE(),
    MAX('Parameter'[Parameter])="Car",[rank_car],
    MAX('Parameter'[Parameter])="Sellby",[rank_sellby])

3. Result:

When selecting Car, sort by car

vyangliumsft_3-1676509620627.png

When choosing Sellby, sort by Sellby

vyangliumsft_4-1676509620630.png

 

 

Best Regards,

Liu Yang

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

Noredlac86
Helper I
Helper I

Hi @Anonymous 
Thanks for your time to read my message and reply. The only problem that i have, is that i have the original tablein that way:

Noredlac86_0-1676476131436.png

 


I just have this, so if i want to know the top 5 sellers, i just add a visual table and i make a count for the column "Sellby" if i want to know the top 5 cars more sells, i make the same, new visual table and count for the car column.

I have tried using this formula, but its not working, cause in the original table i dont have another coumn, and i cant add more columns

 

Anonymous
Not applicable

Hi  @Noredlac86 ,

I created some data:

vyangliumsft_0-1676439727575.png

 

 

Here are the steps you can follow:

1. Create measure.

Sell_measure =
SUMX(
    FILTER(ALL('Table'),'Table'[Sell by]=MAX('Table'[Sell by])),[Sell])
TOP =
RANKX(
    ALLSELECTED('Table'),[Sell_measure],,DESC,Dense)
Flag =
IF(
    [TOP]<=5,1,0)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1676439727575.png

4. Result:

vyangliumsft_2-1676439727578.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors