cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
srikanthgunnam
Helper I
Helper I

SUMX DAX Performance Issue

Hello, I am using a SUMX function in one of my calculation. It is completely degrading the performance of visual. Here is my calculation:

Dummy =
CALCULATE(
              SUMX(DISTINCT(TBL[Account Name]),[Count])
)
In the above calculation count is a measure, which was calculated as follows:
CALCULATE(
              DISTINCTCOUNT(TBL[SaleType])
)
Can you please suggest me a way to improve the performance?
1 ACCEPTED SOLUTION

Hello,

 

Thank you so much for your response. As SUMX is a iterator function, it is degrading the performance. I was helped by some other user with the following solution

CountUnique = COUNTROWS(SUMMARIZE(TBL,TBL[Account Name],TBL[SaleType]))

View solution in original post

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi  @srikanthgunnam ,
 
Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards
Amy

Hello,

 

Thank you so much for your response. As SUMX is a iterator function, it is degrading the performance. I was helped by some other user with the following solution

CountUnique = COUNTROWS(SUMMARIZE(TBL,TBL[Account Name],TBL[SaleType]))

View solution in original post

Hi  @srikanthgunnam  ,

 

Glad to hear the issue is resolved,  you can accept your reply as solution, that way, other community members would benefit from your solution.

 

Best regards

Amy Cai

v-xicai
Community Support
Community Support

Hi @srikanthgunnam ,

 

How about delete the "CALCULATE" in your formula to simplified it. Or try to create measure using DAX below.

 

Dummy = var d= DISTINCTCOUNT(TBL[SaleType])

         return SUMX(DISTINCT(TBL[Account Name]),d)

 

You could refer to below blogs to optimize your DAX formula:

Tune your PowerPivot DAX query, don’t use the entire table in a FILTER and replace SUMX if possible

Nested SUMX or DAX Query?

Please understand that this link is provided AS IS with no warranties or guarantees of content changes, and confers no rights.

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Top Kudoed Authors