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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
joshua1990
Post Prodigy
Post Prodigy

SUM last value for each order

Hi all!

I have a huge table that shows me for each order and each process step the value:

DateOrderProcess StepStatusValue
01.01.2022A1FirstStarted50
01.01.2022A1FirstIn Progress40
01.01.2022A1FirstFinished25
01.01.2022A2FirstStarted50

 

For each process step exists 3 different status:

  • Started
  • In Progress
  • Finished

How I would like to sum up column value for each order based on the last entry.

How is this possible?

2 REPLIES 2
Anonymous
Not applicable

Hi @joshua1990 ,

 

What does "last entry" mean, [Status] = "Finished"?

Please share more details.

 

Best Regards,

Jay

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

I suggest having an index column for the Status column. And then I could select which status is the last status for each date, order, and process step.

Please check the below picture and the attached pbix file.

 

Untitled.png

 

Sum only last status value per order per day: =
VAR _newtable =
    SUMMARIZE (
        Data,
        Data[Date],
        'Order'[Order],
        'Process Step'[Process Step],
        'Status'[Index]
    )
VAR _laststatusonly =
    GROUPBY (
        _newtable,
        Data[Date],
        'Order'[Order],
        'Process Step'[Process Step],
        "@laststatusindex", MAXX ( CURRENTGROUP (), 'Status'[Index] )
    )
RETURN
    CALCULATE (
        SUM ( Data[Value] ),
        TREATAS (
            _laststatusonly,
            'Calendar'[Date],
            'Order'[Order],
            'Process Step'[Process Step],
            'Status'[Index]
        )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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