Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All
After some help with the sample data i have below, i have a column called Reference and want to add a new column which counts how many occurences cumulatively within the data, for example '1472321-2860846' shows up 3 times in the reference column so what i would like is for Power Bi to show that it occurs 3 times but show the 1st instance, 2nd Instance and 3rd Instance if that makes sense, have done a bit of googling and searching this forum but so far havent found a solution
Hoping this communintiy can help
Thanks in advanced
Ash
Solved! Go to Solution.
hi @AshleyJ17
try to
1) add an index column and make it like:
https://learn.microsoft.com/en-us/power-query/add-index-column
2) add a calculated column like:
CumCount =
COUNTROWS(
FILTER(
data,
data[Reference]=EARLIER(data[Reference])
&&data[Index]<=EARLIER(data[Index])
)
)
it worked like:
hi @AshleyJ17
try to
1) add an index column and make it like:
https://learn.microsoft.com/en-us/power-query/add-index-column
2) add a calculated column like:
CumCount =
COUNTROWS(
FILTER(
data,
data[Reference]=EARLIER(data[Reference])
&&data[Index]<=EARLIER(data[Index])
)
)
it worked like:
That worked like a charm thank you FreemanZ 🙂
If you have the time would you be able to explain how this works, im not too familiar with the EARLIER function and would like to get some more understanding on the functions in the formula
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |