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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Cumulative Count for Order/Index

Hey guys, how are you?

 

I'm struggling to try to calculate a cumulative sum in a table, in order to create a sort of index or order for projects.

 

Let's say I have a database related to projects where any change I made to the project, a new key is generated related to that project.

So the structure is like:

https://i.imgur.com/7nO9ic6.jpg

The Project Code field could be repeated as many times as possible and the KEY field is a register in de database which creates a new one every time a change is made to the project, so KEY could not be repeated.

 

What I need to do is to create a CUMULATIVE COUNT of the Key column, for every Project Code.

 

Thank you!

 

 

1 ACCEPTED SOLUTION

@Anonymous

 

You can use a calculated column like

 

Index =
RANKX (
    FILTER ( Table1, [Project Code] = EARLIER ( [Project Code] ) ),
    [Key],
    ,
    ASC,
    DENSE
)

View solution in original post

3 REPLIES 3
richbenmintz
Solution Sage
Solution Sage

Hi @Anonymous

can you provide a sample data model and what the expected output would look like?



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


@Anonymous

 

You can use a calculated column like

 

Index =
RANKX (
    FILTER ( Table1, [Project Code] = EARLIER ( [Project Code] ) ),
    [Key],
    ,
    ASC,
    DENSE
)
Anonymous
Not applicable

THANK YOU! I didn't know the RANKX function!

All I have learned is from Youtube and self-working.

 

Thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.