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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
databot_kd
Helper II
Helper II

DAX measure running slow - How to improve DAX measure performance

Hi Community, 

I am having issues with the performance of my dax measures. I am trying to calculate a opening balance/ running total upto the selected date minus 1 month.  
Hoping somone can provide  guidance on how to improve the performance of it. 

Below are the two DAX Measures 

DAX

ATD =
VAR EoMDate = EOMONTH(MAX('Calendar'[date]) , 0)
VAR App = CALCULATE(SUM('GL'[amount]),  'GL'[Date] <= EoMDate'GL'[data_source] = "glaph") + 0
Return App


OpenBalance =

VAR EomDate1 = EOMONTH(MAX('Calendar'[date]), -1)
VAR OpenBalCALCULATE(SUM('GL [amount]),  'GL'[GLDate] <= EomDate1 , 'GL'[source] = "glhp") + [ATD]
RETURN Bal

                                                  

The selected date is from a calendar table which is linked to GL Table.

Thanks in advance
2 ACCEPTED SOLUTIONS
Uzi2019
Super User
Super User

hi @databot_kd 

VAR App = CALCULATE(SUM('GL'[amount]),  'GL'[Date] <= EoMDate , 'GL'[data_source] = "glaph") 0

 

Remove +0 from measure it will unnecessary  add 0 value to add the levels.

 

i hope it may reduce query time.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

Hi @databot_kd 
You can also take filter function which return the query much faster rather than row by row check the condition.

 

CALCULATE(SUM('GL'[amount]),  'GL'[Date] <= EoMDate , 'GL'[data_source] = "glaph")

Try to take filter finction for this condition.

https://www.youtube.com/watch?v=jcOa4sEMDDs

 

Filter function works faster than without apply filter condition.

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

3 REPLIES 3
databot_kd
Helper II
Helper II

Thanks @Uzi2019 seemed to make it run alot faster. 

 

Hi @databot_kd 
You can also take filter function which return the query much faster rather than row by row check the condition.

 

CALCULATE(SUM('GL'[amount]),  'GL'[Date] <= EoMDate , 'GL'[data_source] = "glaph")

Try to take filter finction for this condition.

https://www.youtube.com/watch?v=jcOa4sEMDDs

 

Filter function works faster than without apply filter condition.

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Uzi2019
Super User
Super User

hi @databot_kd 

VAR App = CALCULATE(SUM('GL'[amount]),  'GL'[Date] <= EoMDate , 'GL'[data_source] = "glaph") 0

 

Remove +0 from measure it will unnecessary  add 0 value to add the levels.

 

i hope it may reduce query time.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors