Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am hitting RAM limitations when running a calculated DAX column on 92 million rows. The calculation works on smaller amounts of data. Any ideas on how to convert this to SQL? I can calculate when loading the data from SQL instead.
Reg Price Column = CALCULATE (MAX ( 'CBG POS_Detail_TEMP'[Avg Price Column] ),FILTER ('CBG POS_Detail_TEMP','CBG POS_Detail_TEMP'[PRODUCT_NBR_RETAILER] = EARLIER ( 'CBG POS_Detail_TEMP'[PRODUCT_NBR_RETAILER] ) && 'CBG POS_Detail_TEMP'[STORE_NUMBER] = EARLIER ( 'CBG POS_Detail_TEMP'[STORE_NUMBER] )), DATESINPERIOD ( 'CBG POS_Detail_TEMP'[WEEK_END_DATE], LASTDATE ( 'CBG POS_Detail_TEMP'[WEEK_END_DATE] ), -84, DAY ))
Solved! Go to Solution.
Hi @bcharlto,
You can modify the T-SQL query like that to return "Reg Price Column":
select * , (select max([Avg Price Column]) from CBG_POS_Detail_TEMP b where b.PRODUCT_NBR_PETAILER=a.PRODUCT_NBR_PETAILER and b.STORE_NUMBER=a.STORE_NUMBER and b.WEEK_END_DATE>=DATEADD(DAY,-84,a.WEEK_END_DATE) and b.WEEK_END_DATE<=a.WEEK_END_DATE) c from CBG_POS_Detail_TEMP a
Best Regards,
Qiuyun Yu
Hi @bcharlto,
You can modify the T-SQL query like that to return "Reg Price Column":
select * , (select max([Avg Price Column]) from CBG_POS_Detail_TEMP b where b.PRODUCT_NBR_PETAILER=a.PRODUCT_NBR_PETAILER and b.STORE_NUMBER=a.STORE_NUMBER and b.WEEK_END_DATE>=DATEADD(DAY,-84,a.WEEK_END_DATE) and b.WEEK_END_DATE<=a.WEEK_END_DATE) c from CBG_POS_Detail_TEMP a
Best Regards,
Qiuyun Yu
Hi @bcharlto,
The DAX you mentioned need to be evaluate in its context. It would be better if you could share some sample data and expected results for our analysis.
Besides, instead of connect to SQL Server in Import mode, please try to connect to it in DirectQuery mode and convert the calculated column DAX to a measure.
Best Regards,
Qiuyun Yu
Hi @v-qiuyu-msft,
This is the same as this issue, but with more data (92 million rows vs. 14 million rows. You could use that example and print screen if you like:
I still have more to test with this report before trying DirectQuery, however I'm not certain that with the limitations and considerations with DirectQuery, I do not think it will work better as an overall solution in this case: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-use-directquery/#benefits-of-using...
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
122 | |
101 | |
71 | |
61 |