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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Le-analysis
New Member

Challenge when aggregating

I am losing sleep over this one.. Any help is appreciated!
I need help with an expression in power BI DAX measure. I have two tables with the following relationship.
'Dim_Time'[Date] 1 -> * Fact_KSD_Logistics[Estimated time of departure]

In the table Fact_KSD_Logistics I have the following columns I want to use for an analysis

Values
1. 'Fact_KSD_Logistics'[Amount NOK Finance]
2. 'Fact_KSD_Logistics'[Total net weight]

Dimensions Rows:
1. 'Fact_KSD_Logistics'[From city]
2. 'Fact_KSD_Logistics'[To city]

Columns:
1. 'Dim_time'[Year]

I have the following expression. On the total for each row I get one value but on the details sum I get another.

 

LY CM Cost / weight = CALCULATE(sum(Fact_KSD_Logistics[Amount NOK Finance])/(sum(Fact_KSD_Logistics[Total net weight])/1000);SAMEPERIODLASTYEAR(Dim_Time[Date]))*(sumx(Fact_Distinct_KSD_Logistics;Fact_KSD_Logistics[Sum of Total net weight])/1000) 

 

 

From cityTo cityYearActual costCM Actual Cost LYCM Net Weight LYTotal net weightCM Cost / MT LYCM LY Price effect
STRAUMENBALTIMORE20235 757 22316 579 0985 0463 0943 28610 168 251
STRAUMENLYON20235 829 63410 832 24931 04931 01334910 819 679
Totals   27 411 34736 09534 10775925 901 236
Totals I want  274113473609534106,575920 987 930

 

The total I want should be 10168251 + 10819679 = 20987930
Instead I am getting 34107 * 759 = 25901236

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Le-analysis ,

 

[CM LY Price effect] is a measure, and then the formula is multiplied by [Total net weight] and [Total net weight], so your total is also two totals multiplied. If you want to solve this problem, you can create a new measure and then use the SUMX function.

 

Measure = SUMX('TableName',[CM LY Price effect])

 

 

Best Regards,

Stephen Tao

 

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

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Le-analysis ,

 

[CM LY Price effect] is a measure, and then the formula is multiplied by [Total net weight] and [Total net weight], so your total is also two totals multiplied. If you want to solve this problem, you can create a new measure and then use the SUMX function.

 

Measure = SUMX('TableName',[CM LY Price effect])

 

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.