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
uif19085
Helper III
Helper III

Days in Status

Hello,
I want to get a column to calculate all the days when a ticket has a certain status, they will be calculated using the "updated" column. For example, for the ticket with the ID: FCAWL21PAS-1011, the days spent in "Analyzed" status will be calculated as follows:
[(first day with different status<here will be Realized>) - (first day in "analyzed")]+[(first day in a diffrent status<here will be Classified>) - (first day in "analyzed")] = 48 days + 3 days = 51 days

For -10474 = from 02/02/2021 to 24/06/2021 = 142 days
For -10578 = from 2/09/2020 to 15/09/2022 + 18/11/2022 to 27/11/2022 = 13 + 9 = 22 dayspost.png

2 REPLIES 2
uif19085
Helper III
Helper III

Hello @amitchandak and thanks for your reply. The column seems to work as i want, but i don't know how to use the measure. I've tried diffrent aproches with it but didn't get what i want. My intention is to get a Column Chart where on X-axis should be the number of days that one ID(ticket) stayed with that Status(here would be only the 3 ids), that would be the sum of all days for an ID with status "Analyzed", would be great if there's a way to group them on intervals(For example <30days: 1id, <60days:1id, <150days:1id and on the Y-axis should have how many IDs had beed found to stayed with that status. I managed to make a table with the data i want where here i can use the measure as a "Values", but when i try to create a chart i can't do it as i described. Hope you understand what im trying to obtain

uif19085_0-1671195905709.png

 

amitchandak
Super User
Super User

@uif19085 , Try a new column like below and add that with filter analyzed in a measure

 

a  new column

 

days =

var _min = minx(filter(Table, [Id] = earlier([ID])  && [Update] > earlier([Update]) ), [Updated])

return 

datediff([Updated], _min,day)+1  //remove +1 if needed

 

Then create a meausre

 

calculate(sum(Table[Days]), filter(Table, Table[Status] = "Analyzed") )

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

 

 

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.