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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Federico92
New Member

Running Count for Selected Values

Hi everyone, I'm new to power by and I want to obtain this results from my data

Federico92_1-1626453568370.png

 

What I want to do is a running count based on the value in fields "Assigned To" that is numerically sorted like in the image below

Federico92_2-1626453601366.png

Any suggestions? Thanks





1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Federico92 ,

this seems to work.

Running Count.png

Count =
VAR OrderID = 'Sample Data'[Order]
RETURN
    CALCULATE (
        COUNTROWS ( 'Sample Data' ),
        FILTER (
            ALLEXCEPT ( 'Sample Data', 'Sample Data'[Group] ),
            'Sample Data'[Order] <= OrderID
        )
    )

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

3 REPLIES 3
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Federico92 ,

can you provide sample data and describe which column is used for sorting?
In the image with the expected result, I don't see any reference to the "Assigned To" column.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


https://drive.google.com/file/d/1pTdvJHx7GQokfhmI4AiOxQIkWtCxR5WC/view?usp=sharing

I simplified the problem to make it easier to understand. In the linked PBIX I would like to get the results in the "Expected Results" column. What I want it to do is calculate a distinct running count for each value of the "Group" column.
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Federico92 ,

this seems to work.

Running Count.png

Count =
VAR OrderID = 'Sample Data'[Order]
RETURN
    CALCULATE (
        COUNTROWS ( 'Sample Data' ),
        FILTER (
            ALLEXCEPT ( 'Sample Data', 'Sample Data'[Group] ),
            'Sample Data'[Order] <= OrderID
        )
    )

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.