Forum Discussion
Performance issue with a DAX formula
- 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
removed post due to data coruption
Hi Elorian
Please confirm I have understood.
You have a historty table like this
| Ticket | Event_ID | Startdate | Enddate |
| 1 | 50 | 01/01/2021 | 08/01/2021 |
| 8 | 60 | 03/01/2021 | 13/01/2021 |
| 12 | 70 | 05/01/2021 | 14/01/2021 |
| 21 | 50 | 08/01/2021 | 16/01/2021 |
| 28 | 72 | 17/01/2021 | 19/01/2021 |
| 33 | 73 | 22/01/2021 | 21/01/2021 |
| 39 | 50 | 31/01/2021 | 26/01/2021 |
| 48 | 75 | 03/02/2021 | 29/01/2021 |
| 54 | 76 | 10/02/2021 | 02/02/2021 |
A calnedra tbale like this
| Date | Working day |
| 01/01/2021 | 0 |
| 02/01/2021 | 0 |
| 03/01/2021 | 0 |
| 04/01/2021 | 1 |
| 05/01/2021 | 1 |
| 06/01/2021 | 1 |
And you wnat a rpwort like this for Event-ID 50 only tickets ?
| Ticket | Event_ID | Startdate | Enddate | Working days |
| 1 | 50 | 01/01/2021 | 08/01/2021 | 4 |
| 21 | 50 | 08/01/2021 | 16/01/2021 | 5 |
| 39 | 50 | 31/01/2021 | 26/01/2021 | 10 |
- Elorian4 years ago
Resolver I
Hi speedramps,
In a simplify way, yes, that's that (except I don't count the working days but the non-working days).
Kr,
Elorian
- speedramps4 years ago
Super User
So you want a report with the number of non working days per ticket. But only show event-id =50 tickets on the report???
- Elorian4 years ago
Resolver I
No, not on a report... I want a calculated column with that number of non working day for all tickets with event-id 50, but with the size of tables I mentionned in my initial post. The formula I'm using (see post) is working, but apparently it ruins the performance of Power BI afterwards --> want to know if my formula is 1) correct and 2) can be improved to not kill performances