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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MattJacob
Frequent Visitor

Create a transitioning table between two selected dates

Hello, 

 

I would like to track movements in statuses from our cases.

So therefore I would like to create a status transitioning table between two selected dates. 

 

I have a dataset with among which three colums:

Date

Case ID

Status

 

We have >10.000 Cases and ~10 statuses.

 

I would like to create an output like this

 

Table           Status1                Status2            Status3       ...

Status1           A                         B                       C

Status2           D                         E                       F

Status3            G                         H                     I

...

 

Where A is the number of cases that were in Status1 at the first selected date and at status1 at the second selected date.

Where F is the number of cases that were in Status2 at the first selected date and at status3 at the second selected date.

Where G is the number of cases that were in Status3 at the first selected date and at status1 at the second selected date.

So cases can go forwards and backwards.

 

I have looked everywhere to create this.

 

Can you help me?

 

Thanks you very much!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MattJacob ,

 

I suggest you to create unrelated dimtables to help your calculation.

vrzhoumsft_0-1693898133302.png

The relationship between these tables are all inactive.

Measure:

Count =
VAR _GEN1 =
    GENERATE ( 'Status(Row)', 'Status(Column)' )
VAR _GEN2 =
    GENERATE ( _GEN1, VALUES ( 'Table'[Case ID] ) )
VAR _SELECT1 =
    SELECTEDVALUE ( DimDate1[Date] )
VAR _SELECT2 =
    SELECTEDVALUE ( DimDate2[Date] )
VAR _ADDFlag =
    ADDCOLUMNS (
        _GEN2,
        "Flag",
            VAR _1 =
                CALCULATE (
                    MAX ( 'Table'[Status] ),
                    FILTER (
                        'Table',
                        'Table'[Case ID] = EARLIER ( [Case ID] )
                            && 'Table'[Date] = _SELECT1
                    )
                )
            VAR _2 =
                CALCULATE (
                    MAX ( 'Table'[Status] ),
                    FILTER (
                        'Table',
                        'Table'[Case ID] = EARLIER ( [Case ID] )
                            && 'Table'[Date] = _SELECT2
                    )
                )
            RETURN
                IF ( [Status(Row)] = _1 && [Status(Column)] = _2, 1, 0 )
    )
VAR _FILTER =
    FILTER ( _ADDFlag, [Flag] = 1 )
VAR _SUMX =
    ADDCOLUMNS (
        _GEN1,
        "Sumx",
            SUMX (
                FILTER (
                    _FILTER,
                    [Status(Row)] = EARLIER ( [Status(Row)] )
                        && [Status(Column)] = EARLIER ( [Status(Column)] )
                ),
                [Flag]
            )
    )
RETURN
    SUMX ( _SUMX, [Sumx] )

Result is as below.

vrzhoumsft_1-1693898170914.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @MattJacob ,

 

I suggest you to create unrelated dimtables to help your calculation.

vrzhoumsft_0-1693898133302.png

The relationship between these tables are all inactive.

Measure:

Count =
VAR _GEN1 =
    GENERATE ( 'Status(Row)', 'Status(Column)' )
VAR _GEN2 =
    GENERATE ( _GEN1, VALUES ( 'Table'[Case ID] ) )
VAR _SELECT1 =
    SELECTEDVALUE ( DimDate1[Date] )
VAR _SELECT2 =
    SELECTEDVALUE ( DimDate2[Date] )
VAR _ADDFlag =
    ADDCOLUMNS (
        _GEN2,
        "Flag",
            VAR _1 =
                CALCULATE (
                    MAX ( 'Table'[Status] ),
                    FILTER (
                        'Table',
                        'Table'[Case ID] = EARLIER ( [Case ID] )
                            && 'Table'[Date] = _SELECT1
                    )
                )
            VAR _2 =
                CALCULATE (
                    MAX ( 'Table'[Status] ),
                    FILTER (
                        'Table',
                        'Table'[Case ID] = EARLIER ( [Case ID] )
                            && 'Table'[Date] = _SELECT2
                    )
                )
            RETURN
                IF ( [Status(Row)] = _1 && [Status(Column)] = _2, 1, 0 )
    )
VAR _FILTER =
    FILTER ( _ADDFlag, [Flag] = 1 )
VAR _SUMX =
    ADDCOLUMNS (
        _GEN1,
        "Sumx",
            SUMX (
                FILTER (
                    _FILTER,
                    [Status(Row)] = EARLIER ( [Status(Row)] )
                        && [Status(Column)] = EARLIER ( [Status(Column)] )
                ),
                [Flag]
            )
    )
RETURN
    SUMX ( _SUMX, [Sumx] )

Result is as below.

vrzhoumsft_1-1693898170914.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you so much! It worked!
lbendlin
Super User
Super User

If this is coming from SFDC data then it will be much easier to use the field history object for the case object. It records all these transitions automatically.

 

otherwise, Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors