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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Sum Status Change for each day/week/month

I currently have a table in the following format.

DateItem IDStatus
10/11closed
10/12closed
10/13closed
10/14Draft
9/301open
9/302work completed
9/303closed
9/291open
9/292work completed
9/29 3closed
9/281

open

9/282open
9/283open

 

Each item is also associated to a company table where each company can have multiple items but no item can have multiple companies.

 

How can I get a calculation over time showing how many items each company had an item move from one status to the other among all the permutations eg.

open to open

open to work completed

open to in dispute

open to closed

work completed to open

and so on

 

 

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Anonymous 
Please refer to attached sample file with the solution.

2.png1.png

Number of Changes = 
SUMX (
    VALUES ( Company[Company] ),
    CALCULATE ( 
        SUMX ( 
            VALUES ( Company[Item ID] ),
            VAR CurrentIDTable = CALCULATETABLE ( 'Table' )
            RETURN
                SUMX ( 
                    CurrentIDTable,
                    VAR CurrentStatus = 'Table'[Status]
                    VAR CurrentDate = 'Table'[Date]
                    VAR TableBefore = FILTER ( CurrentIDTable, 'Table'[Date] < CurrentDate )
                    VAR PreviousRecord = TOPN ( 1, TableBefore )
                    VAR PreviousStatus = COALESCE ( MAXX ( PreviousRecord, 'Table'[Status] ), CurrentStatus )
                    RETURN
                        IF ( CurrentStatus <> PreviousStatus, 1 )
                )
        )
    )
)
Anonymous
Not applicable

It seems I incorrectly described what I am looking for, my apologies.

Results should show changes of each status from one to another for example:

Company A
Status Open to Open (qty)

Status Open to Work Completed (qty)

Status Open to Ready to Inspect (qty)

Work Completed to Open (qty)

so since there are 7 possible initial statuses (Draft, Open, Work Completed, Ready to Inspect, Not Approved, In Dispute and Closed) there should be 1(initial status)x7(final status)= 7potential permutations where a change can be in for each item over time.

 

Hi @Anonymous 

please use an example to describe the expected results based on the same sample data. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.