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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-rongtiep-msft
Community Support
Community Support

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.