Forum Discussion
Anonymous
6 years agoNot applicable
DiffDate between two dates with where or IF condition
Hi DAX Community! Im new with the Power BI Report Builder, and I'm trying to do following: I am building a Defect Report which is finished to most part, now i want to implement a lead-time ta...
- Anonymous6 years ago
I solved my Problem by a workaround. I created a new column with sql which gives me the dates of the specific statuschanges and then i said DateDiff(CreatedDate, InAnalysisDate, Day) and its working now like that.
Then i Also created a Measure which give me an average time of all 21k issues to get 1Value
smpa01
6 years agoCommunity Champion
Anonymous are you looking for this ?
Measure :=
DATEDIFF (
CALCULATE (
MAX ( T[Date] ),
FILTER ( ALLEXCEPT ( T, T[ID] ), T[Status] = "CREATED" )
),
CALCULATE (
MAX ( T[Date] ),
FILTER ( ALLEXCEPT ( T, T[ID] ), T[Status] = "Closed" )
),
DAY
)Sample Data
| ID | Date | Status |
| 10353 | 1/1/2019 | CREATED |
| 10353 | 2/1/2019 | Verified |
| 10353 | 3/1/2019 | Planned |
| 10353 | 4/1/2019 | Closed |
| 10354 | 1/1/2018 | CREATED |
| 10354 | 2/1/2018 | Verified |
| 10354 | 5/1/2018 | Closed |
Anonymous
6 years agoNot applicable
i tried it out, doesnt seem to work.. smpa01 but in your example its working i dont know what im doing wrong