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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi there!
I am trying to implement a column like so:
| animal | count |
| cat | 1 |
| dog | 1 |
| mouse | 1 |
| cat | 2 |
| dog | 2 |
| mouse | 2 |
| cat | 3 |
| mouse | 3 |
| cat | 4 |
| dog | 3 |
| mouse | 4 |
Where for each instance of animal, a count is incremented. Essentially, it is 3 independant counters, each counting the occurance of that animal.
Any thoughts?
Thanks!
Im trying something like this at the moment:
Count =
VAR countCat = CALCULATE(RANKX('Table','Table'[Animal],,ASC,Dense), FILTER('Table','Table'[Animal]="Cat"))
return countCat
I will have the other animals as VARs as well and an if statement in my return statement to assign values for each row.
Solved! Go to Solution.
@Anonymous
Hi
First add an Index Column from the Query Editor
Then you can RANK based on that Index to get the desired calcualted column
i.e
Count =
RANKX (
FILTER ( Table1, Table1[animal] = EARLIER ( Table1[animal] ) ),
[Index],
,
ASC
)
@Anonymous
Hi
First add an Index Column from the Query Editor
Then you can RANK based on that Index to get the desired calcualted column
i.e
Count =
RANKX (
FILTER ( Table1, Table1[animal] = EARLIER ( Table1[animal] ) ),
[Index],
,
ASC
)
@Anonymous
File attached as well
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!