Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi,
Suppose i have a dataset
Date Val Count
01/01/19 A 1
02/01/19 B 1
03/01/19 C 1
04/01/19 A 2
05/01/19 D 1
06/01/19 E 1
07/01/19 B 2
08/01/19 A 3
I would like to create a calcualted column (count) which counts the number of times a value (Val) appears in the dataset. The count needs to increment by 1 each time it comes across the same value.
Any help will be appreciated
Thanks
Solved! Go to Solution.
@Anonymous Please try this as a New Column.
Count = COUNTROWS(FILTER(ALL(Test06),[Date]<=EARLIER(Test06[Date]) && [Val] = EARLIER(Test06[Val])))
Proud to be a PBI Community Champion
@Anonymous Please try this as a New Column.
Count = COUNTROWS(FILTER(ALL(Test06),[Date]<=EARLIER(Test06[Date]) && [Val] = EARLIER(Test06[Val])))
Proud to be a PBI Community Champion
Hi @PattemManohar ,
Thank you for your solution. Suppose I didnt have the date column and just wanted to count based on the Val column purely. How would you modify the formula to do so?
Thank you
@Anonymous In that case, try adding an Index field and use that Index column instead of Date field. But if you don't want that too, considering having only [val] column then in that case, you can't get running total but can have grand total count against each val. that appeared in the whole dataset.
Proud to be a PBI Community Champion
Hello Sir,
I saw your reply on how to count those repeats and it does work; however, I have a table with 2.5 million rows and this approach take a very long time. Do you have another method that would achive the same reuslts but more efficient for larger data sets? ~Thank You
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 52 | |
| 41 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 107 | |
| 103 | |
| 40 | |
| 33 | |
| 25 |