Forum Discussion
Power BI Desktop Extremely Slow
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
Just figured that file upload option is not available here.
May be you can contact on my email id for file or any other option to share you the file.
Regards
- luxpbi8 years ago
Helper V
Hi Kumail,
Thank you for your time and your answer, but I can't really se the code there, maybe you could post it in a comment.
In the meantime I have made some modifications and I made it simplier and it works fine.Days =
VAR CurrentProduct = 'Table1'[Product]
VAR CurrentDate = 'Table1'[Date]
VAR CurrentNMov = 'Table1'[Index_]
VAR NextStateDate =
CALCULATE (
MIN ( 'Table1'[Date] );
FILTER (
'Table1';
'Table1'[Product] = CurrentProduct
&& 'Table1'[Date] >= CurrentDate
&& 'Table1'[Index_] > CurrentNMov
)
)
RETURN
IF (
ISBLANK ( NextStateDate );
( TODAY () - CurrentDate )
+ 1;
( NextStateDate - CurrentDate )
+ 1
)
What I'm thinking is that maybe instead of a calculated column I could use a measure.
Have you tested my original code and yours with DAX Studio?Regards,
- Kumail8 years ago
Impactful Individual
TestDays = 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 )Even in measure, its working perfectly fine; as fast as any other feature in power bi
- luxpbi8 years ago
Helper V
Works fast because of the size of the dataset. When you have 2 million rows is veeeery slow..
Do you think is there a way to optimize it?- Kumail8 years ago
Impactful Individual
Not sure. Actually I was extremely busy on something therefore, couldn't reply you yesterday.
I have used python for my clients for processing large dataset and created a csv or excel file for visualization (If you are not querying data directly from CRM). That generally works well for me.