Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi!
I have the next challenge ahead, but I have not been able to solve. I tell you, I want to have a dynamic index that only depends on the records shown in a table. I give you an example:
I have the next table with Countries and cities:
Country | City |
Spain | Barcelona |
Spain | Bilbao |
UK | Liverpool |
UK | London |
Spain | Madrid |
UK | Manchester |
What I would like to have is a measure which allows creating the following index "#" (I have tried it with a calculated column, but when it is calculated in processing time and not in execution time, it is not possible):
# | Country | City |
1 | Spain | Barcelona |
2 | Spain | Bilbao |
3 | UK | Liverpool |
4 | UK | London |
5 | Spain | Madrid |
6 | UK | Manchester |
In the event that we filter by "Spain" it should show the following:
# | Country | City |
1 | Spain | Barcelona |
2 | Spain | Bilbao |
3 | Spain | Madrid |
If we look at the first table we have "City = Madrid" with a value in the measure "#" of 5, in the second table the value taken by the "#" is 3, which is correct, since it occupies the position 3 of the table.
In principle, you don't want this index to be conditioned by anything, which I think Rank functions aren't valid.
Does anyone dare to help me? Is it possible to do?
Thanks!
Best Regards
Solved! Go to Solution.
@MMartin , Sequence no in visual table is not supported yet
I logged an idea for that
Serial No in Visual Table
https://ideas.powerbi.com/ideas/idea/?ideaid=80612ec5-14a9-4929-a2ee-531943fa51d4
As of now I can think of measure
count = countx(filter(Table,[City]<=max(Table[City])),Table[City])
@MMartin , Sequence no in visual table is not supported yet
I logged an idea for that
Serial No in Visual Table
https://ideas.powerbi.com/ideas/idea/?ideaid=80612ec5-14a9-4929-a2ee-531943fa51d4
As of now I can think of measure
count = countx(filter(Table,[City]<=max(Table[City])),Table[City])
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
8 |