Forum Discussion
Elorian
4 years agoResolver I
Performance issue with a DAX formula
Hello, My case is the following : 1) I have a big history table of all events occuring on the tickets of my DB, basically with the type of the event, the start date and the end date. The only event...
- 4 years ago
Hello,
The solution in itself is not correct, because your FILTER argument is not 1 expression and it creates an error.
Nevertheless, based on your idea, the following formula seems to work at least better :
+Diff_Time (days_ooo) =VAR daysooo =FILTER(_TimeTable,_TimeTable[OpenDaysFR] = 0 &&_TimeTable[Date] >= DATE(YEAR(HISTORY[+Prev History_ChgDate per request]),MONTH(HISTORY[+Prev History_ChgDate per request]),DAY(HISTORY[+Prev History_ChgDate per request])) &&_TimeTable[Date] <= DATE(YEAR(HISTORY[CHANGED_DATE]),MONTH(HISTORY[CHANGED_DATE]),DAY(HISTORY[CHANGED_DATE])))RETURNIF(HISTORY[EVENT_ID] = 50,COUNTROWS(daysooo),BLANK())Kr,Elorian
speedramps
4 years agoSuper User
I am an unpaid power bi volunteer
Please can you click Accept As Solution to give kudos and then raise another ticket.
Ive answered your question well. But you didnt mention it had to be a calculated field. Thanks
😞
Elorian
4 years agoResolver I
Hello,
The solution in itself is not correct, because your FILTER argument is not 1 expression and it creates an error.
Nevertheless, based on your idea, the following formula seems to work at least better :
+Diff_Time (days_ooo) =
VAR daysooo =
FILTER(_TimeTable,
_TimeTable[OpenDaysFR] = 0 &&
_TimeTable[Date] >= DATE(YEAR(HISTORY[+Prev History_ChgDate per request]),MONTH(HISTORY[+Prev History_ChgDate per request]),DAY(HISTORY[+Prev History_ChgDate per request])) &&
_TimeTable[Date] <= DATE(YEAR(HISTORY[CHANGED_DATE]),MONTH(HISTORY[CHANGED_DATE]),DAY(HISTORY[CHANGED_DATE]))
)
RETURN
IF(
HISTORY[EVENT_ID] = 50,
COUNTROWS(daysooo),
BLANK()
)
Kr,
Elorian