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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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


Anonymous
Not applicable

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors