Forum Discussion
Power BI Desktop Extremely Slow
Hi v-piga-msft,
They are not similar, here I'm asking why Power BI get a lot of time working on it when I select to create a new measure.
What is he doing there? Why a complex or not optimized DAX Measure or Column will afect that?
For me there is no reason for that.
In the other, I'm asking for a tool that can measure the performance of different DAX measures.
Kumail I can't share the pbix file for security reasons but I can share with you the formula:
Days =
VAR CurrentProduct = 'Table1'[Product]
VAR CurrentState = 'Table1'[Status]
VAR CurrentDate = 'Table1'[Date]
VAR CurrentNMov = 'Table1'[Index_]
VAR CurrentCodTaller = 'Table1'[Type]
VAR NextStateDate =
CALCULATE (
MIN ( 'Table1'[Date] );
FILTER (
'Table1';
'Table1'[Product] = CurrentProduct
&& ( 'Table1'[Status] <> 8
|| 'Table1'[Status] <> 9 )
&& 'Table1'[Date] >= CurrentDate
&& 'Table1'[Index_] > CurrentNMov
&& (
'Table1'[Type] <> CurrentCodTaller
|| 'Table1'[Type] = BLANK ()
|| 'Table1'[Type] = CurrentCodTaller
)
)
)
VAR LastMov =
CALCULATE (
MIN ( 'Table1'[Date] );
FILTER (
'Table1';
'Table1'[Product] = CurrentProduct
&& 'Table1'[Date] >= CurrentDate
&& 'Table1'[Index_] > CurrentNMov
)
)
RETURN
IF (
CurrentState = 8
|| CurrentState = 9;
IF (
ISBLANK ( LastMov );
( TODAY () - CurrentDate )
+ 1;
IF ( ISBLANK ( NextStateDate ); 1; ( NextStateDate - CurrentDate ) + 1 )
)
)
Regards,
- Kumail8 years ago
Impactful Individual
Okay. Could you send sample dummy data as well?
- Kumail8 years ago
Impactful Individual
Okay. Could you send sample dummy data as well
- luxpbi8 years ago
Helper V
Hi Kumail,
Sorry for the delay, but if being very busy.
This is some dummy Data:NÂș S Date Status Type Type Name Product Index Days A 12/06/2017 7 X 10175089 11 A 22/06/2017 2 X 10213994 2 A 23/06/2017 7 X 10216732 15 B 07/07/2017 2 X 10274288 2 B 08/07/2017 2 X 10275632 1 B 08/07/2017 7 X 10276544 15 B 22/07/2017 2 X 10331471 1 B 22/07/2017 8 X 10333186 3 B 24/07/2017 2 X 10340907 1 B 24/07/2017 7 X 10341725 19 B 11/08/2017 2 X 10411062 1 C 11/08/2017 12 X 10414030 1 C 11/08/2017 2 X 10415081 2 C 12/08/2017 7 X 10417554 15 C 26/08/2017 2 X 10475511 1 C 26/08/2017 2 X 10476606 2 C 27/08/2017 7 X 10482842 8 Please, notice that I've changed a little bit my code, now it looks like this:
Days = VAR CurrentProduct = 'Table1'[Product] VAR CurrentState = 'Table1'[Status] VAR CurrentDate = 'Table1'[Date] VAR CurrentNMov = 'Table1'[Index_] VAR CurrentCodTaller = 'Table1'[Type] VAR NextStateDate = CALCULATE ( MIN ( 'Table1'[Date] ); KEEPFILTERS ( 'Table1'[Status] <> 8 || 'Table1'[Status] <> 9 ); FILTER ( 'Table1'; 'Table1'[Product] = CurrentProduct && 'Table1'[Date] >= CurrentDate && 'Table1'[Index_] > CurrentNMov && ( 'Table1'[Type] = BLANK () || 'Table1'[Type] <> CurrentCodTaller || 'Table1'[Type] = CurrentCodTaller ) ) ) VAR LastMov = CALCULATE ( MIN ( 'Table1'[Date] ); FILTER ( 'Table1'; 'Table1'[Product] = CurrentProduct && 'Table1'[Date] >= CurrentDate && 'Table1'[Index_] > CurrentNMov ) ) RETURN IF ( ISBLANK ( LastMov ); ( TODAY () - CurrentDate ) + 1; ( NextStateDate - CurrentDate ) + 1 )- Kumail8 years ago
Impactful Individual
Hi luxpbi
I have tested the dax expression. Initially, it was giving number of syntax errors, however, it worked with some minor tweaks. The image and file is attached for your reference.
Regards
Kumail
Analytics and BI Practitioner
Email: [email protected] Skype: kumailrazakazi