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
Chris_Price
Helper I
Helper I

DAX to calculate Statuses Journey

Hi Everyone - am new to Powerbi and looking for an URGENT help please. My sample data is as follows;

 

Workitem No.StatusDate_Time
Sep-20 3450912Active4/7/20 13:10
Sep-20 3450912Pending14/8/20 20:40:15
2309185934Pending6/5/2020_10:20:06
2309185934Active20/8/2020_23:18:24
2309185934Closed25/8/2020_12:27:02
IUS123049512Active5/3/2020_14:10:25
IKO093845751Closed15/10/2020_17:27:18
120349567Pending18/12/2019_19:24:48
120349567Active26/2/2020_08:34:10
120349567Closed10/6/2020_20:34:18
120349567Pending20/7/2020_16:38:20

 

I need to calculate the following using above data;

1) How many workitems are 'closed' within 24 hrs SLA?

2) How many workitems are moved from 'Pending' to 'Active' status within 24 hrs?

3) How many workitems are re-opened (after closed status)?


@v-xuding-msft 

@amitchandak  @Greg_Deckler @Ashish_Mathur @Zubair_Muhammad

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Chris_Price ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1602833102980.png

 

Best regards,
Lionel Chen

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

@v-lionel-msft

unfortunately Q1 and Q3 are coming out weirdly like this;

86F93CFF-80BC-4AC3-B376-F1BE00639C5F.jpeg

It should show me team wise split when put in a table ?

amitchandak
Super User
Super User

@Chris_Price , Try formula's like

 

meet SLA= countx(filter(summarize(Table,Table[Workitem No],"_1", datediff(calculate(min(Table[Date_Time]), filter(Table, Table[Status]= "Pending"))
,calculate(min(Table[Date_Time]), filter(Table, Table[Status]= "Closed")), hour)
), [_1] <=24),[Workitem No])
moved Active= countx(filter(summarize(Table,Table[Workitem No],"_1", datediff(calculate(min(Table[Date_Time]), filter(Table, Table[Status]= "Pending"))
,calculate(min(Table[Date_Time]), filter(Table, Table[Status]= "Active")), hour)
), [_1] <=24),[Workitem No])
moved Open= countx(filter(summarize(Table,Table[Workitem No],"_1", datediff(calculate(Max(Table[Date_Time]), filter(Table, Table[Status]= "Closed"))
,calculate(max(Table[Date_Time]), filter(Table, Table[Status]= "Active")), hour)
), [_1] >0),[Workitem No])

 

Proposed solution doesn't work @amitchandak the way I wanted to be. 
For e.g in condition 1- applied measure still shows statuses as Active, Pending and Closed both while I want to see only those cases which were Closed within 24 hrs SLA. 

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.