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
glmoon5
Helper I
Helper I

Index Key

I have a Top_20 table that has [Geographies] as a column listed multiple times because the table also contains Product UPCs and associated sales with them.

 

I need to create an index on the [Geographies] column so that the index stays the same until a new geography shows in the table. How can I achieve this??

1 ACCEPTED SOLUTION

Hi @glmoon5 ,

Thanks for reaching out to Microsoft fabric Community Forum.

Based on the sample data as you provided as per the query :

 

  • You can create a Geography-based index in Power BI by first sorting the data by Geography.
  • Then removing duplicates from a duplicated Geography column, adding an index to that unique list, and finally merging it back with the original table to assign a consistent index per Geography group.

Expected output :

vaatheeque_0-1745232453309.png

Reference : Add an index column - Power Query | Microsoft Learn

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

View solution in original post

15 REPLIES 15
ryan_mayu
Super User
Super User

@glmoon5 

do you want to create a calcuated column or a measure? could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu 

 

A calculated Index key

then could you pls proivde some sample data and expected output? We don't need top 20, maybe just top 3 or top 5 sample data





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I don't have the data handy.....I was thinking this was pretty straight forward for someone how knows more about PBI that me?

It's difficult to provide a solution without a sample data and the expected result from that. It's  like trying to hit a target without properly aiming at it.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian @ryan_mayu 

 

How about this:

 

GeographyBrandDollar Sales
GEO 1BRAND 1$16,789,338
GEO 1BRAND 2$9,911,549
GEO 1BRAND 2$5,022,607
GEO 1BRAND 4$5,694,625
GEO 1BRAND 5$19,823,097
GEO 1BRAND 6$5,084,486
GEO 2BRAND 1$60,139,860
GEO 2BRAND 2$44,031,651
GEO 2BRAND 2$31,547,579
GEO 2BRAND 4$5,544,625
GEO 2BRAND 5$22,015,826
GEO 2BRAND 6$21,490,223

What result exactly do you expect from that sample data?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I have a Top_20 table that has [Geographies] as a column listed multiple times because the table also contains Product UPCs and associated sales with them.

 

I need to create an index on the [Geographies] column so that the index stays the same until a new geography shows in the table. How can I achieve this??

Hi @glmoon5 ,

Thanks for reaching out to Microsoft fabric Community Forum.

Based on the sample data as you provided as per the query :

 

  • You can create a Geography-based index in Power BI by first sorting the data by Geography.
  • Then removing duplicates from a duplicated Geography column, adding an index to that unique list, and finally merging it back with the original table to assign a consistent index per Geography group.

Expected output :

vaatheeque_0-1745232453309.png

Reference : Add an index column - Power Query | Microsoft Learn

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

Hi @glmoon5 ,

We haven’t heard back from you regarding our previous response and wanted to check if your issue has been resolved.

If it has, please consider clicking “Accept Answer” and “Yes” if you found the response helpful.
If you still have any questions or need further assistance, feel free to let us know — we're happy to help!

Thank you!

 

Hi @glmoon5 ,

If our response addressed by the community member for your query, please mark it as Accept Answer and click Yes if you found it helpful.

Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

Hi @glmoon5 ,

We haven’t heard back from you regarding our previous response and wanted to check if your issue has been resolved.

If it has, please consider clicking “Accept Answer” and “Yes” if you found the response helpful.
If you still have any questions or need further assistance, feel free to let us know — we're happy to help!

Thank you!

Hi,

Based on the table that you have shared, show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I have a Top_20 table that has [Geographies] as a column listed multiple times because the table also contains Product UPCs and associated sales with them.

 

I need to create an index on the [Geographies] column so that the index stays the same until a new geography shows in the table. How can I achieve this??

Show the expected result very clearly.  Also, do you want a measure or a calculated column?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.