Forum Discussion

joshs444444's avatar
joshs444444
Frequent Visitor
3 years ago

Measure Not Calculating Correctly

I am trying to figure out the cost inflation over time for a set of items.

 

I have an average unit cost measure, but when I pull it into a table I have, and line charts, it does not calculate correctly.

 

Right now I have the measure for average Unit Cost:

Average Unit Cost =
AVERAGEX( 'All Purchase Line','All Purchase Line'[Unit Cost])
 
here is what the table looks like:
 

 

I want the total to be the sum of all rows in the table, divided by the count. However this is now what it is doing.

 

I have a couple filters applied to the table:

 

One for year (2020-2023) another for Item (top 50 by purchase spend) and another by high spend (yes) -this is in the item table

 

My datamodel is here:

 

 

Please let me know if I can provide any further clarification

 

Any help is appreciated.

1 Reply