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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Berl21
Helper III
Helper III

Adding a row number in a matrix

Hi,

I need to add row numbers to one matrix visualisation that I made. Since the column that is used for that is based on a letter format instead of numbers, I added an index column in Power Query for this column.

The plan was to write a measure with rankx based on this index column, but it doesn't work as I want it to. Apparently I am not understanding how exactly this measure works.

 

For example:
- combining Rankx with an ALL filter gives me either a mistake (no results shown), or doesn't recognize the index column

- while removing ALL and working only the index column, I need an agregation command that doesn't work.

For instance this leads to nowhere, since MIN can only show "1" for each rank.

Row Number 2 = RANKX(
    Account_Liste,MIN(Account_Liste[Index])
)

I am stumped. Can anyone help?
 
Thanks,
 
Pauline.
2 REPLIES 2
v-yinliw-msft
Community Support
Community Support

Hi @Berl21 ,

 

You can add the index column directly into the matrix.

You can add the index column to row first, and then add the other columns.

vyinliwmsft_0-1667184896947.png

 

Hope this helps you.

 

Best Regards,

Community Support Team _Yinliw

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

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your desired outcome looks like, but please try below.

 

Row Number 2 =
RANKX ( ALL ( Account_Liste ), CALCULATE ( MIN ( Account_Liste[Index] ) ) )

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.