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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cycle through status records

Hi Guys, 

 

ive gotthis data set.

 

the rules are to be for each Scenario ID, which has multiple Steps and statuses,

 

I need to set the Overall status based on the statuses for all the steps for each Scenario ID

 

Scenario ID            Step Number      Status

IOJ-0001 1Planned
IOJ-0001 2Completed
IOJ-0001 3Comleted
IOJ-0001 4N/A
IOJ-0001 5N/A
IOJ-0001Livia 6Planned
IOA-0001 1Error
IOA-0001 2In Progress
IOA-0001 3N/A
IOA-0001 4Error
IOA-0001 5N/A
IOA-0001 6Blocked
IOA-0001 7Retest
IOA-0001 8N/A

 

So for IOJ-0001 

the rules 

 

If all Steps are Completed, then the Overall status is set to Complete

if any steps are in error, the overall steps are ERROR

if All steps are in progress overall steps in progress

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

try a measure like

Measure = 
var _isCompleted = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]),'Table'[Status]="Completed")
var _isError = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]),'Table'[Status]="Error")
var _isInProgress = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]),'Table'[Status]="In Progress")
var _rowsByID = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]))
RETURN
SWITCH(TRUE(),
_isCompleted = _rowsByID, "Completed",
_isError > 0, "Error",
_isInProgress = _rowsByID, "In Progress",
BLANK()
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

1 REPLY 1
az38
Community Champion
Community Champion

Hi @Anonymous 

try a measure like

Measure = 
var _isCompleted = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]),'Table'[Status]="Completed")
var _isError = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]),'Table'[Status]="Error")
var _isInProgress = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]),'Table'[Status]="In Progress")
var _rowsByID = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Scenario ID]))
RETURN
SWITCH(TRUE(),
_isCompleted = _rowsByID, "Completed",
_isError > 0, "Error",
_isInProgress = _rowsByID, "In Progress",
BLANK()
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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