cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tengkuhanis
Regular Visitor

How to create an increment counter column based on how many entries a same person submit

Hi everyone. Can somebody help me? I am a beginner at Power BI. 

The scenario is I have a table that stores data of entries submitted by employees. I want to create a column that counts incrementally whenever the same person submits an entry. The example that I want is as below:

 

STAFF NAMECOUNTER COLUMN
Hanis1
Hanis2
Faiz1
Amira1
Hanis3
Syafiq1
Faiz2



As you can see above, when 'Hanis' submit her first entry ever, the counter starts with one. Then when she submit more entry, the counter increments. The same goes for 'Faiz'.

 

Can anybody help me to create this counter column? TQ in advance!

4 REPLIES 4
tengkuhanis
Regular Visitor

Hi @Jihwan_Kim,

 

Thank you very much for your interest to help me with this. However, I found out that my idea to use a counter is not a suitable approach for me to cater to the user requirement that I am trying to solve.

I could not share the pbix file since it is company confidential. However I have a new question instead which is more specific to what is the actual problem I am facing now. You can go to the link below to view my question and I hope you can suggest your method there. TQ in advance! This is the link:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-count-rows-based-on-two-conditions-sim... 

Jihwan_Kim
Super User
Super User

Hi,

I assume the table contains something like lognumber column or logdate column to identify the difference of the sampe person's each row.

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1663642019731.png

 

Counter column CC = 
CALCULATE (
    COUNTROWS ( DISTINCT ( Data[LogNumber] ) ),
    FILTER (
        Data,
        Data[STAFF NAME] = EARLIER ( Data[STAFF NAME] )
            && Data[LogNumber] <= EARLIER ( Data[LogNumber] )
    )
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


hi there, thank you so much for your reply. I believe this could be a solution but since I don't have the log number column in my table, I could not proceed with this. I tried to add the LogNumber column first but unfortunately, the PQ says that I don't have credentials or something like that. I'm not sure what is the problem but thank you anyways for your help!

Hi,

Thank you for your feedback.

Please share your pbix file's link (Onedrive, googledrive, dropbox, any other) here, and then I can try to look into it to come up with a more accurate solution.

Thank you.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors