Forum Discussion
music43
Advocate II
5 years agoPerformance problem with simple measure chain
Hi I am in the early stages of learning DAX. I have what I think is a simple chain of measures BUT my Quantity Sold (over nWeeks) is taking 3 minutes to reurn the results so clearly I have an iss...
amitchandak
Super User
5 years agomusic43 , this seems fine. Do you bi-directional joins and a lot of visuals on the page.
Can make bi-directional join as single direction and check.
if not can you share the data model?
- music435 years ago
Advocate II
Hi amitchandak
The model hasn't got any unusual relationships.
Unfortunately I can't share the model as it contains company data ☹️
The only other useful information I could provide is this:
and the query performance code (which I don't fully understand yet)
// DAX Query DEFINE VAR __DS0FilterTable = TREATAS({"6 weeks"}, 'WeekRange'[Week Range (for AWS)]) VAR __DS0FilterTable2 = FILTER( KEEPFILTERS(VALUES('dimCalendar'[DATE: DATE])), AND( 'dimCalendar'[DATE: DATE] >= DATE(2020, 1, 1), 'dimCalendar'[DATE: DATE] < DATE(2020, 12, 1) ) ) VAR __DS0Core = SUMMARIZECOLUMNS( ROLLUPADDISSUBTOTAL('dimProduct'[PRODUCT: NUMBER TEXT], "IsGrandTotalRowTotal"), __DS0FilterTable, __DS0FilterTable2, "Number_of_Weeks_for_AWS__Default__26_", 'M E A S U R E S'[Number of Weeks for AWS (Default: 26)], "Product_Age_in_Weeks__new_", 'M E A S U R E S'[Product Age in Weeks (new)], "Total_Quantity_Shipped", 'M E A S U R E S'[Total Quantity Shipped], "Quantity_Sold__over_nWeeks_", 'M E A S U R E S'[Quantity Sold (over nWeeks)] ) VAR __DS0PrimaryWindowed = TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'dimProduct'[PRODUCT: NUMBER TEXT], 1) EVALUATE __DS0PrimaryWindowed ORDER BY [IsGrandTotalRowTotal] DESC, 'dimProduct'[PRODUCT: NUMBER TEXT]Thanks