Forum Discussion
How to add a Serial Row Number Column in Power BI Table / Matrix visual?
- 9 years ago
Hi ShmuelM,
Grabbing in your table just add a measure with the countrows:
Row_Number = CALCULATE ( COUNTROWS(Profit_Table), FILTER ( ALLSELECTED ( Profit_Table ), Profit_Table[Position] <= MAX ( Profit_Table[Position]) ) )As you can see in the print below it counts the number of rows no matter if you have slicer or not, left table is the full data, right table is influenced by slicer.
Please be aware that this measure is influenced by the order of your Position so if you want to order by another column this will give you the row number in a different order also.
Regards,
MFelix
Hi ShmuelM,
Grabbing in your table just add a measure with the countrows:
Row_Number =
CALCULATE (
COUNTROWS(Profit_Table),
FILTER ( ALLSELECTED ( Profit_Table ), Profit_Table[Position] <= MAX ( Profit_Table[Position]) )
)As you can see in the print below it counts the number of rows no matter if you have slicer or not, left table is the full data, right table is influenced by slicer.
Please be aware that this measure is influenced by the order of your Position so if you want to order by another column this will give you the row number in a different order also.
Regards,
MFelix
Save my day! Thanks!
MFelix wrote:Hi ShmuelM,
Grabbing in your table just add a measure with the countrows:
Row_Number = CALCULATE ( COUNTROWS(Profit_Table), FILTER ( ALLSELECTED ( Profit_Table ), Profit_Table[Position] <= MAX ( Profit_Table[Position]) ) )As you can see in the print below it counts the number of rows no matter if you have slicer or not, left table is the full data, right table is influenced by slicer.
Please be aware that this measure is influenced by the order of your Position so if you want to order by another column this will give you the row number in a different order also.
Regards,
MFelix
Save my day! Thanks!
- LauraBueno6 years ago
Helper III
Hi! I have a similar problem and just tried your formula and it is working fine for me as well! Thanks!
Just quick question, I would like to use the measure created in a graph, so that I plot my variable vs this counter we've created, but it is not working.
Any idea how to do this?
Thanks a lot in advance!
- LauraBueno6 years ago
Helper III
Hi! I have a similar problem and just tried your formula and it is working fine for me as well! Thanks!
Just quick question, I would like to use the measure created in a graph, so that I plot my variable vs this counter we've created, but it is not working.
Any idea how to do this?
Thanks a lot in advance!