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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
PBI_nick
Helper I
Helper I

Counter for orders

Hey guys!

 

I have some problems cause it`s first try to take some exp in PBI. So, I`ll be really greatful for help!

Task: I should count nums of order, for example we have first entry 12 and it`s - 1, second one - 2 and so on. 

I`m trying to make it like that: counter = countrows(filter(database, [nums of order] = earlier([nums of order])))

But it`s not for me, cause that formula just count total value of entries. As I see its should be another one column like that:

 

Nums of orderCounter
121
122
131
141
123

 

Danke!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@PBI_nick , with this data you will not be able to create a counter.

Add index column  first

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

the try a new column

 countX(filter(database, [nums of order] = earlier([nums of order]) &&[Index] <= earlier([Index]) ),[nums of order])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@PBI_nick , with this data you will not be able to create a counter.

Add index column  first

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

the try a new column

 countX(filter(database, [nums of order] = earlier([nums of order]) &&[Index] <= earlier([Index]) ),[nums of order])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

It`s work! Thank you very much! Have a nice day 🙂

FarhanAhmed
Community Champion
Community Champion

Can you please post some output data that you required ?

 

 







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

Proud to be a Super User!




vanessafvg
Community Champion
Community Champion

HI i am not 100% sure about the pattern you are posting, is the table you have provided what you want to end up with, or is that what your data looks like? can you show what you want to end up with?




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




The main idea is show in the table. At the end i`ll have:

create_datetimetotal sum (sum of orders)nums of orderscounter
some datasome data121
some datasome data122

 

Something like that if i understand u correctly. Doesnt show data in two first columns cause it neednt as I think

@PBI_nick 

You need another column that can be used as an identifier for each row. Then, it will easy to differentiate each row in order to apply some ranking or count. Provide a valid data set to check.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

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.