Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone,
I have a table which has a column, let's say called "Comments". I have created a slicer that lists all the comments and the user can select only the comments that they want. Based on the selection, the selected comments are shown in a Table. What I want to do is to show another column in the Table that will include 1,2,3 etc. For example, if the user selects to show 4 comments I want to show 1 on the left of the 1st comment, 2 on left of the 2nd comment and so on.
Any ideas?
Thanks
Solved! Go to Solution.
Hi @Aria89 ,
Based on your description, I created this data.
Create the measure as SamWiseOwl said.
Measure =
RANK(SKIP,ALLSELECTED('Table'),ORDERBY('Table'[Comment]))
Successfully returned the expected result, you can refer to the attachment I provided to compare with your file. If possible, you can also provide your data (with sensitive data removed) so that we can better help you solve the problem.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Aria89 ,
Based on your description, I created this data.
Create the measure as SamWiseOwl said.
Measure =
RANK(SKIP,ALLSELECTED('Table'),ORDERBY('Table'[Comment]))
Successfully returned the expected result, you can refer to the attachment I provided to compare with your file. If possible, you can also provide your data (with sensitive data removed) so that we can better help you solve the problem.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Aria89
Create a measure that ranks by the order your comments are in.
I assume its alphabetical so something like this:
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Thanks for the response. I created that measure but when i add it in the visual, all the values are disappeared... Any ideas what can be wrong?
What else is in the table visual?
Are you applying any filters to the visual?
The row would dissapear if the measure is returning blank.
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Tha table visual only has the Comments column and the new measure that I created. Note that that table has another column as well with Dates but I am not filtering based on the dates.
Could you do a mock up of a few comments and any other columns in that table.
My data is very simple
RegionId RegionName
1 East Anglia
2 East Midlands
3 London
etc
It should work on yours.
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
@Aria89 , Basically you are trying to add index in table then try below method
Create an Index Column: You need to create an index column that will generate the sequence numbers (1, 2, 3, etc.) for the selected comments.
Add a Custom Column in Power Query:
Go to the "Transform Data" option to open Power Query Editor.
Select your table.
Add a new custom column by clicking on "Add Column" > "Custom Column".
Use the following formula to create an index column:
= Table.AddIndexColumn(#"PreviousStepName", "Index", 1, 1, Int64.Type)
Replace #"PreviousStepName" with the name of the previous step in your query.
Apply Changes: Click "Close & Apply" to apply the changes and return to the Power BI report view.
Use the Index Column in Your Table Visualization:
Add the new index column to your table visualization.
Ensure that the slicer is set up to filter the comments as required.
Proud to be a Super User! |
|
Thanks for your response.
The thing is that if I just add an index column, the number associated with each comment is not going to change dynamically. I want the numbers shown in my table visual to always be 1,2,3,4 etc no matter what comments have been selected in the slicer.
Ok got it than you can use RANK function as stated by @SamWiseOwl to create a measure and use it
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |