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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Let-Me-Know
Frequent Visitor

Getting dynamic serial numbers for rows in Matrix Visual

Dear all,

 

My goal is to implement dynamic serial numbers for rows in a Matrix Visual.

My input data is „Data Table“ with these columns:

Name

Parent

Employee

Influencer

John

YES

YES

YES

Peter

YES

NO

NO

Mary

NO

YES

NO

Luke

NO

NO

YES

 

Since with the matrix visual I wanted to show only persons who are parents AND/OR influencers, I have created conditional column „Parent and/or Influencer“ using this conditions:

If „Parent“ equals „YES“ then „YES“,

Else if „Influencer“ equals „YES“ then „YES“,

Else „NO“.

 

In the visual filter I have used the „Parent and/or Influence“ with value „YES“, and the results are:

Name

Parent

Influencer

John

YES

YES

Peter

YES

NO

Luke

NO

YES

 

Now I am struggling with for example RANKX and ALLSELECT functions in order to get serial numbers in my visual. The outcome which I would like to have is this:

Serial No.

Name

Parent

Influencer

1

John

YES

YES

2

Peter

YES

NO

3

Luke

NO

YES

 

What I want is to make it dynamic. Next time I refresh data for upcoming quarter, I want the serial numbers to fit properly.

I appreciate your help.

3 REPLIES 3
amitchandak
Super User
Super User

@Let-Me-Know , Try the new rownumber function released in April 2023

 

example

New Row Number = ROWNUMBER(ALLSELECTED(Table[Name]),ORDERBY(Table[Name],asc))

https://powerbi.microsoft.com/en-us/blog/power-bi-april-2023-feature-summary/#post-23001-_Toc8262252...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Or, what would be a solution with COUNT and OR functions, aka Excel way to count:

COUNT how many people are a parent OR an influencer?

In my example, there are three of them.

 

I would then put that number in another table visual.

Hi, @amitchandak 

 

Thnx for the hint.

You gave an example:

New Row Number = ROWNUMBER(ALLSELECTED(Table[Name]),ORDERBY(Table[Name],asc))

 

But how would it look like if you had implemented my table and column titles? Would it look like this?

ROWNUMBER = ROWNUMBER(ALLSELECTED(Data Table),ORDERBY(Data Table[Parent and/or Influence],asc))

 

 

I have tried that but it does not work. After I add that measure as a column in my table, I get the message

 

LetMeKnow_0-1683187961878.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.