Forum Discussion
Dynamic Measure based on slicer selection
- Anonymous1 year ago
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.
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.
- Aria891 year agoHelper I
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.
- bhanu_gautam1 year agoSuper User
Ok got it than you can use RANK function as stated by SamWiseOwl to create a measure and use it