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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
alexa_0028
Resolver II
Resolver II

Performance issue using calculate and SUMX

Hi All,

I am having a table visual and I am seeing slow performance while adding the measure "test_acc" and it seems to load very slow.

test_acc =
var test_1 = calculate('Sales'[Volumes], left('Product'[Code],3)="ACC")
RETURN
calculate(SUMX('Sales', test_1 ),'Calendar'[cytd_flag]=1)

Please let me know how can i improve my formula if any great suggestions?
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@alexa_0028 , try like

 

test_acc =
var test_1 = calculate(sum('Sales'[Volumes]), left('Product'[Code],3)="ACC")
RETURN
calculate( test_1,'Calendar'[cytd_flag]=1)

 

or

 

test_acc =
var test_1 = calculate(sum('Sales'[Volumes]), filter('Product', left('Product'[Code],3)="ACC"))
RETURN
calculate( test_1,filter('Calendar','Calendar'[cytd_flag]=1))

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

View solution in original post

alexa_0028
Resolver II
Resolver II

Hi All,

With some retrying, I figured out the way to optimise. The formula I pasted above indeed worked, I was looking the performance along with old measures therefore it was showing high values.
Thank you so much @amitchandak  for pointing me to right direction.

test_acc =
var test_1 = calculate('Sales'[Volumes],KEEPFILTER( left('Product'[Code],3)="ACC") ,KEEPFILTER('Calendar'[cytd_flag]=1))
RETURN
test_1



View solution in original post

4 REPLIES 4
alexa_0028
Resolver II
Resolver II

Hi All,

With some retrying, I figured out the way to optimise. The formula I pasted above indeed worked, I was looking the performance along with old measures therefore it was showing high values.
Thank you so much @amitchandak  for pointing me to right direction.

test_acc =
var test_1 = calculate('Sales'[Volumes],KEEPFILTER( left('Product'[Code],3)="ACC") ,KEEPFILTER('Calendar'[cytd_flag]=1))
RETURN
test_1



alexa_0028
Resolver II
Resolver II

I tried to rewrite my measure like below , it didn't improve performance much but gave right result:

test_acc =
var test_1 = calculate('Sales'[Volumes], left('Product'[Code],3)="ACC" ,'Calendar'[cytd_flag]=1)
RETURN
test_1

Please help me to optimize the DASX ?

alexa_0028
Resolver II
Resolver II

Hi @amitchandak ,

Thanks for your reply, it did improved performance a lil more.
But this solution doesn't give me the right results. I am looking for the results like highlighted in green but I am getting the value of the volume measure only in test_acc




alexa_0028_0-1632220482499.png

 

amitchandak
Super User
Super User

@alexa_0028 , try like

 

test_acc =
var test_1 = calculate(sum('Sales'[Volumes]), left('Product'[Code],3)="ACC")
RETURN
calculate( test_1,'Calendar'[cytd_flag]=1)

 

or

 

test_acc =
var test_1 = calculate(sum('Sales'[Volumes]), filter('Product', left('Product'[Code],3)="ACC"))
RETURN
calculate( test_1,filter('Calendar','Calendar'[cytd_flag]=1))

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.