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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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


View solution in original post

3 REPLIES 3

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


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.

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


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.