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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Amrselim1989
Helper II
Helper II

Optimizing sumx

hello,

kinldy i have very simple sumx calculation 

 

it iterates agients 3 million row in a table and about 300 rows in another table;

the code is 

 

Sum of Net Sales Value in USD = sumx('Table', 'Table'[Net Sales Value] / RELATED(RateDate[USD Price]))
 
the table i have is like this but with 3 millions rows and has dublicate in Date column
Date Net Sales Value
1/1/2019 10
1/1/2019 20
1/1/2019 45
1/2/2019 67
1/2/2019 87
1/3/2019 45
1/4/2019 44
 
the RateDate USD is my currency to USD rate:
 
1/1/2019 4
1/2/2019 5
1/3/2019 5
1/3/2019 5
 
my code in visual gives me visual has excedded avaiabale resources, i know it's be cause the itration, can i optimize this code at least to summerize sales of a single date they divide it on USD rate, but it must be itrated on date by date to perserving the USD rate day by day?!!
1 ACCEPTED SOLUTION
mickey64
Super User
Super User

For your reference.

I use ’SUM’ instead of 'SUMX'.

 

Step 1: I make a calendar table and add 2 relationships.

mickey64_0-1695339255346.png

Step 2: I make a measure below.

    Measure = DIVIDE(SUM('Table'[Net Sales Value]),AVERAGE('RateDate'[USD Price]))

 

Step 3: I make a matrix below.

mickey64_1-1695339385002.png

 

 

View solution in original post

1 REPLY 1
mickey64
Super User
Super User

For your reference.

I use ’SUM’ instead of 'SUMX'.

 

Step 1: I make a calendar table and add 2 relationships.

mickey64_0-1695339255346.png

Step 2: I make a measure below.

    Measure = DIVIDE(SUM('Table'[Net Sales Value]),AVERAGE('RateDate'[USD Price]))

 

Step 3: I make a matrix below.

mickey64_1-1695339385002.png

 

 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors