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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

I need to create index column on the visual

actual result

yaparlasreenath_0-1649851320237.png

desired result 

yaparlasreenath_2-1649852030996.png

 

i need dynamic index column on the visual based on price column  (price column should be in ascending order)

 

8 REPLIES 8
Anonymous
Not applicable

Hi @Anonymous ,

 

You could also use countrows() function.

column:

countrow_ = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[price]<=EARLIER('Table'[price])))
vjaywmsft_0-1650446653178.png

Measure:

count_rows = CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[price]<=MAX('Table'[price])))
vjaywmsft_2-1650446800010.png

 

Best Regards,

Jay

Anonymous
Not applicable

Hi jayw ,

I don't need index numbers based backend whole dataset, i need dynamic index for example
if i apply any filter the index value is recalculate

Hi @Anonymous ,

If you are going to create  a column, it will not be dynamically indexing the records based on your selections.

 

The Only way to get dynamic nature to your index values is by creating measures.

You can check out the below two sugesstions on this

https://community.powerbi.com/t5/Desktop/I-need-to-create-index-column-on-the-visual/m-p/2465967#

 

https://community.powerbi.com/t5/Desktop/I-need-to-create-index-column-on-the-visual/m-p/2465967#

 

Regards,

 

Greg_Deckler
Community Champion
Community Champion

In addition the @Thejeswar you could also use the Mythical DAX Index. The Mythical DAX Index - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler ,

Sure let me check that out. Thanks!!

Thejeswar
Super User
Super User

Hi @Anonymous ,

You need to create a Rank based on the Price and Use this Rank Measure as your index column in the visual.

 

index :=
RANKX ( ALL (Table), 'Table'[price] ,, ASC)
 
When used in a measure
index :=
RANKX ( ALL (Table), CALCULATE(SUM('Table'[price])) ,, ASC)
Anonymous
Not applicable

Hi tejeswar , when i try to implement the same logi i got below error.

 

A single value for column 'Final Unit price with zeros' in table 'udm_sales_fact' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggr

Hi @Anonymous ,

It clearly tells you what the error is!!

 

In a measure you have to use aggregate for a column. Like SUM(Table[Price]).

May be you can try this

index :=
RANKX ( ALL (Table), CALCULATE(SUM('Table'[price])) ,, ASC)
 
*Updated my previous reply as well

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.