Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ak77
Post Patron
Post Patron

DAX memory Issue-Need Help in optimization

Hi All,

 

i have a below DAX where i need to calculate Total returns for all  products for a selected client Since Inception(Start Date) to selected report date. i am using the below DAX. This works well but if i select recent dates it startes givinf memore exceed issue . Is there a way to optimize this DAX by further filters like (applying  extra filter for selected client ) or any other approach for calculated table to be used? please help . Thanks 

 

SinceInception =

VAR reportSelectedDate = MAX('Date Table'[LastDayOfMonth])

VAR yearCount=DATEDIFF([ProductStartDate],_selectedDate, DAY)/365

VAR _NewTotal =
CALCULATE(100 * (power( EXP ( ( SUM ( Client_Returns_Data[Returns] ) ) ),(1/yearCount))- 1),
CALCULATETABLE(
FILTER(VALUES('Date Table'[_Date]),

'Date Table'[_Date] >= [ProductStartDate] && 'Date Table'[_Date] <= _selectedDate
), ALL('Date Table')
))

Return
_NewTotal

2 REPLIES 2
ak77
Post Patron
Post Patron

@amitchandak , Thanks for reply.. i implemented the updated DAX u provided and seems to be working with initial testing. not yet tested completly.

 

Thanks again.. Can u please help  understand .. how the updated DAX helped in improvement?

amitchandak
Super User
Super User

@ak77 , Try like

 

SinceInception =

VAR reportSelectedDate = MAX('Date Table'[LastDayOfMonth])

VAR yearCount=DATEDIFF([ProductStartDate],_selectedDate, DAY)/365

VAR _NewTotal =
CALCULATE(100 * (power( EXP ( ( SUM ( Client_Returns_Data[Returns] ) ) ),(1/yearCount))- 1),
FILTER(ALL('Date Table'),

'Date Table'[_Date] >= [ProductStartDate] && 'Date Table'[_Date] <= _selectedDate
)
)

Return
_NewTotal

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.