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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
PBE
Helper II
Helper II

Dynamic Row Numbering for PBI Table

Hi I have data which I will be filtering by Work Type. In this example A & B

 

PBE_1-1688663953239.png

What I want to do is add a Row No. Column which updates for different work types.

Examples below:-

Select A on slicer

PBE_2-1688664151807.png

It numbers the filtered rows 1 to 8

Select B on slicer

PBE_4-1688664293418.png

It numbers the filtered rows 1 to 5

Is there a way to do this in DAX?

 

Thank you for any help.

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@PBE In theory you could create a measure like this:

Row No Measure = 
  VAR __Table = ALLSELECTED('Table')
  VAR __ID = MAX( 'Table'[ID] )
  VAR __Result = COUNTROWS( FILTER( __Table, [ID] <= __ID ) )
RETURN
  __Result


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...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@PBE In theory you could create a measure like this:

Row No Measure = 
  VAR __Table = ALLSELECTED('Table')
  VAR __ID = MAX( 'Table'[ID] )
  VAR __Result = COUNTROWS( FILTER( __Table, [ID] <= __ID ) )
RETURN
  __Result


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...

Thanks @Greg_Deckler that worked well

Thanks I'll give it a go

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors