Forum Discussion
Index Key
- 1 year ago
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 :
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!
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.
How about this:
| Geography | Brand | Dollar Sales |
| GEO 1 | BRAND 1 | $16,789,338 |
| GEO 1 | BRAND 2 | $9,911,549 |
| GEO 1 | BRAND 2 | $5,022,607 |
| GEO 1 | BRAND 4 | $5,694,625 |
| GEO 1 | BRAND 5 | $19,823,097 |
| GEO 1 | BRAND 6 | $5,084,486 |
| GEO 2 | BRAND 1 | $60,139,860 |
| GEO 2 | BRAND 2 | $44,031,651 |
| GEO 2 | BRAND 2 | $31,547,579 |
| GEO 2 | BRAND 4 | $5,544,625 |
| GEO 2 | BRAND 5 | $22,015,826 |
| GEO 2 | BRAND 6 | $21,490,223 |
- Ashish_Mathur1 year agoSuper User
Hi,
Based on the table that you have shared, show the expected result very clearly.
- glmoon51 year agoHelper I
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??
- Ashish_Mathur1 year agoSuper User
Show the expected result very clearly. Also, do you want a measure or a calculated column?
- danextian1 year agoSuper User
What result exactly do you expect from that sample data?
- glmoon51 year agoHelper I
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??
- v-aatheeque1 year agoCommunity Support
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 :
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!