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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
tb92
Frequent Visitor

Status Tracking

Hello everyone, I have the following table;

 

ID               Date          Status

105/05/2023A
106/05/2023B
201/02/2023A
201/04/2023C
305/05/2023A
306/05/2023C

 

I would like to define the following ;

 

Measure 1 = COUNT (Status A to Status B) = 1 Total

 

Measure 2 = COUNT (Status A to Status C) = 2 Total 

 

Which would allow to me to count how many unique IDs have changed from A to B and from A to C over time.

 

Could anyone provide me with some help on this?

 

Many Thanks 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @tb92 
Dax formula for your first request :

Distinct Count A To B =
CALCULATE(
    DISTINCTCOUNT('Table'[ID]),
    FILTER(
        'Table',
        'Table'[Status] = "B" &&
        CALCULATE(
            MAX('Table'[Date]),
            FILTER(
                'Table',
                'Table'[ID] = EARLIER('Table'[ID]) &&
                'Table'[Status] = "A"
            )
        ) <'Table'[Date]
    )
)
 
For Second :
Distinct Count A To C =
CALCULATE(
    DISTINCTCOUNT('Table'[ID]),
    FILTER(
        'Table',
        'Table'[Status] = "C" &&
        CALCULATE(
            MAX('Table'[Date]),
            FILTER(
                'Table',
                'Table'[ID] = EARLIER('Table'[ID]) &&
                'Table'[Status] = "A"
            )
        ) <'Table'[Date]
    )
)
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @tb92 
Dax formula for your first request :

Distinct Count A To B =
CALCULATE(
    DISTINCTCOUNT('Table'[ID]),
    FILTER(
        'Table',
        'Table'[Status] = "B" &&
        CALCULATE(
            MAX('Table'[Date]),
            FILTER(
                'Table',
                'Table'[ID] = EARLIER('Table'[ID]) &&
                'Table'[Status] = "A"
            )
        ) <'Table'[Date]
    )
)
 
For Second :
Distinct Count A To C =
CALCULATE(
    DISTINCTCOUNT('Table'[ID]),
    FILTER(
        'Table',
        'Table'[Status] = "C" &&
        CALCULATE(
            MAX('Table'[Date]),
            FILTER(
                'Table',
                'Table'[ID] = EARLIER('Table'[ID]) &&
                'Table'[Status] = "A"
            )
        ) <'Table'[Date]
    )
)
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you this is perfect 🙂 

It was my pleasure to assist 🙂 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.