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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Kopek
Helper IV
Helper IV

Running row number in a matrix hierarchy

Hi!

 

I am facing issue with numbering rows in a matrix.

I do have a matrix vizualization which has a 4 level of information, data are dynamically changing per client.

What i want to do is to add a running row number, to be able to split the matrix into pages (e.g want to show first 10 rows in a 1st page, rows 10-20 in the 2nd page, 20-30 in a 3rd page, and so on).

Unfortunately i am struggling with having a proper number sequence in a matrix. I was able to achieve this in a table vizualization but it does not meet my requirements unfortunately.

 

I was able to achieve this with a table:

 

Kopek_1-1697633857856.png

whereas in matrix numbers are messed-up, not visible in all lvls, sometimes duplicated

 

Kopek_2-1697633895804.png

 

what ideally i want to achieve is a running row number, which will be showing number of rows in a vizualization regardless of hirerachy split/ values similar to what we do have in an excel:

 

Kopek_3-1697634106895.png

 

 

 

 

 

 

 

 

 

5 REPLIES 5
Kopek
Helper IV
Helper IV

Hi @lbendlin  , thank you for the effort, much appreciate!

unfortunateluy this solution does not work for me for two reasons:

1- some of the hirerachy elemnts are same accross branches;
2- if i select client 7777 the row  rank is not starting with 1,2,3.... but is starts with 14,15,16....
i will be looking for som eother solutions:)

1 - this is where it is important for your to provide sample data that fully covers the issue.  I have a couple ideas how to disambiguate that.

 

lbendlin_0-1698764660189.png

 

 

2 - can be fixed by using ALLSELECTED() instead of ALL()

 

lbendlin_0-1698763307076.png

 

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi @lbendlin ,

Thanks for coming back to me. I have prepared very simple sample PBI file.
What i want to achieve with this is to have an additional column next to value (or somewhere esle..) which will give some kind of index for currently vizible rows. 

It means that it needs to number visible rows dynamically, after all filters are implemented.
I am a ble to achieve this is the table format, but unfrotunatelly struggling with having that index column in the matrix with the hirerarchy level.

Hope now it is more clear.

Please find the data and some screenshots below:

Client IDLvl1lvl2lvl3Value
123AAAAabababawyx123
123AAAAabababaxyz999
123AAAAabababaxyz14
123AAAAcdcdcdcwwww1000
123AAAAcdcdcdcrrrrrr46
123AAAAcdcdcdcyyyyy18
123BBBBvvvvnynyny13
123BBBBnnnnnmjmjm13
123BBBBnnnnnmjmjm16
7777CCCCadadadtttt345
7777CCCCadadadtttt456
7777CCCCadadadyhyhy467
7777CCCCadadadyhyhy67
7777CCCCffffuuuu99
7777CCCCffffuuuu98
7777CCCCffffuuuu65
7777DDDDzzzzOooo56
7777DDDDzzzzllllll56
7777DDDDzzzzxxxxx66
7777DDDDcccccbgbgbgb56

 

Index column scenarios:

 

Client 123:

 

 

Kopek_0-1698665108209.png

 

 

Client 7777

 

Kopek_1-1698665130275.png

 

multiple selections:

 

 

Kopek_2-1698665151559.png

 

Thanks in advance for any tips 🙂

 

 

My first reaction was "Whoa, this is far outside the design envelope for Power BI!"  But after thinking about it for a while I think this may even be possible.  Here is the first step:

 

lbendlin_0-1698703876129.png

Next step would be to count the unique values of Lvl1 and Lvl2 to add to the ROWNUMBER tally.

lbendlin_1-1698705340414.png

This gets us a little closer but the upper levels are still incorrect.

Now onto figuring out where we are in the matrix

lbendlin_0-1698711693471.png

And here it is in all its fragile beauty

lbendlin_1-1698714946273.png

This works only if each element of the hierarchy is unique across all branches. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.