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
Anonymous
Not applicable

Get a list of repeat offenders

Looking to get a list of only the Model where Status went from Active to {Inactive, Unknown, anything else} and back to Active.

 

The status change can happen multiple times in a day.

 

Following scenario should return only Model 1 as the status went from Active to some other status and came back to Active.

 

Here's the sample data,

status.PNG

 

Appreciate your inputs!

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

First, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490.

 

Second, I'm not sure I am 100% on the requirements. If things change multiple times during a single day, there is no time component so it would be impossible to tell the "last" or "first" value unless you have something like an Index column.

 

Third, perhaps something like the following:

Measure =
  VAR __Model = MAX('Table'[Model])
  VAR __FirstDate = MINX('Table',[Date])
  VAR __LastDate = MAXX('Table',[Date])
  VAR __FirstStatus = MINX(FILTER('Table','Table'[Date]=__FirstDate),[Status])
  VAR __LastStatus = MAXX(FILTER('Table','Table'[Date]=__LastDate),[Status])
  VAR __OtherStatus = 
        IF(
          COUNTROWS(
            FILTER(
              ALL('Table'),
              'Table'[Date] >= [FirstDate] && 
                'Table'[Date] <= [LastDate]) &&
            )
          ) > 0,
          1,0
        )
RETURN
  IF(__FirstStatus = "Active" && __LastStatus = "Active" && __OtherStatus = 0,1,0)
  



      

 

Put that in a visualization along with Model.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg Thank you for your inputs. I will keep the guidelines in mind.

 

Let's ignore the same day changes for the sake of simplicity. 

 

While looking at the assignment for __OtherStatus, did you mean to add another filter for Status column? The way I understand, it is counting all rows rows between FirstDate and LastDate and assigning 1 or 0 based on that. Shouldn't it count the rows when 'Table'[Status] IN {"Unknown", "Inactive", "Something else"}

 

Here's the actual table instead of a picture.

 

DateModelStatus
202003011Active
202003012Active
202003032Active
202003041Inactive
202003042Active
202003051Unknown
202003054Active
202003053Unknown
202003071Active
202003083Unknown

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.