Forum Discussion
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
- amitchandakSuper 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))
- Let-Me-KnowFrequent Visitor
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
- Let-Me-KnowFrequent Visitor
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.