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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors