Forum Discussion
Performance issue while a report start
- Anonymous4 years ago
Hi Anonymous,
Perhaps you can try to use the following measure formula to calculate results without summary across multiple tables:
formula = VAR currProduct = VALUES ( DimProduct[Product_id] ) VAR saleList = CALCULATETABLE ( VALUES ( Sales[InvoiceID] ), FILTER ( ALLSELECTED ( Sales ), Sales[Product_id] IN currProduct ) ) VAR forcastList = CALCULATETABLE ( VALUES ( Forecast[InvoiceID] ), FILTER ( ALLSELECTED ( Forecast ), Forecast[Product_id] IN currProduct ) ) RETURN CALCULATE ( COUNTROWS ( VALUES ( Invoice[CustoID] ) ), FILTER ( ALLSELECTED ( Invoice ), [InvoiceID] IN INTERSECT ( saleList, forcastList ) ) )Regards,
Xiaoxin Sheng
Hi, Anonymous - I am trying to understand the business requirement for the measure. It appears that you want the Number of Unique Customers which who brought products that appear in the Sales and Forecast table? Your approach to calculating this will not be performant because the distinctcount function will require a complete table scan and this after performing a complete table scan on Sales and Forecast. If you use Dax Studio to analyse the DAX Query obtained from performance analyser, you will see lots of SE Queries and FE processing. To help further, I would need to see the Data Model and some sample data. Is it possible to provide a link to a PBIX?
- Anonymous4 years agoNot applicable
Hi Anonymous
Thanks for the reply.
yes i did the troubleshooting with Dax studio and i confirm that i have a lot of of SE Queries and FE processing.
This the reason why i share the question , to have some recommendation to improve that .
Yes you are right for the business requirement.
Thanks