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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abhinav_003
Regular Visitor

Dynamic Index

Hello Community!,

I want to create a dynamic Index as a measure or a calculated column, so that I can see the number of rows according to the filtered data based on 'Region' or 'State'.

I have the date like:

abhinav_003_0-1675330074604.png

 

I have tried creating an index column from the Power Query but when I filter out the data according to the region, it doesn't shows the new Index from 1 to the number of rows, it shows the index value of that particular Customer name, 
For eg:

abhinav_003_1-1675330232964.png

 

What I want is to show the Index value from 1 according to the filtered.
I would really appreciate your help a lot.

Thanks & Regards,

Abhinav

 

3 REPLIES 3
Anonymous
Not applicable

Hi @abhinav_003 ,

Please have a try.

Create a measure.

Measure = VAR _REGION=RANKX(FILTER(ALL('Table'),'Table'[Region]=SELECTEDVALUE('Table'[Region])),CALCULATE(MAX('Table'[Index])),,ASC,Skip)
VAR _OTHER=RANKX(FILTER(ALL('Table'),'Table'[OTHER]=SELECTEDVALUE('Table'[OTHER])),CALCULATE(MAX('Table'[Index])),,ASC,Skip)
VAR _ER=IF(SELECTEDVALUE('Table (2)'[Column1])="OTHER",_OTHER,IF(SELECTEDVALUE('Table (2)'[Column1])="Region",_REGION,IF(SELECTEDVALUE('Table (2)'[Column1])=BLANK(),_REGION)))
RETURN _ER

vpollymsft_0-1675751082251.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@abhinav_003 , You can create a rank column

 

For Rank Refer to these links
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

Column Rank: https://www.youtube.com/watch?v=wDS_Vi4r9I4&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=39

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hey @amitchandak thanks for your reply,
I tried 'Rankx' function but it is ranking all of them the same (1), I have attached the output as well as the formula of the same, please tell me where did I make the mistake.


Thanks & Regards, 
Abhinav.

abhinav_003_0-1675399194657.png

 

abhinav_003_1-1675399222671.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.