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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
klowrizer
New Member

Sumx totals on measures

I am having a problem with my total column and getting the sum to work correctly on of of the field. It's a measure which goes off of a couple other measures and i can't get the total to work. 

 

The data is as follows:

Item No.CurrentCostBaselineCostInvoicedQtyUnitCostBLUnitCostUnitPPVPPV
10214011,80225,2372,4004.924.85

.06

154.72
12017006,2777,07629216.44228.25-11.81-342.37
TOTAL18,07932,3122,4297.446.181.273,075

 

All of the cells in green above are working correct.  The cells in purple don't work, but I don't need the totals on them.  The Red one isn't working and I need it to work. The total i need it to show is the following: -187.65

 

Explanation of each of the columns: 

1. Current Cost:

Summary: The Cost of the purchase of the item YTD.

Dax: CurrentCost =

var Year = [SelectedYear]
return
SUMX(
'Inventory Transactions_V',
CALCULATE(
CALCULATE(
Sumx('Inventory Transactions_V','Inventory Transactions_V'[Cost]),
Filter('Inventory Transactions_V', YEAR('Inventory Transactions_V'[Posting Date]) = Year),
FILTER('Inventory Transactions_V','Inventory Transactions_V'[Item Ledger Entry Type Description] = "Purchase")
)
)
)
2. Baseline Cost: The purchase cost of the item YTD. The dax is the same as Current Cost, except the year is -1
3. Invoice Qty: The purchase quantity of the item YTD. The dax is the same as Current Cost, except the summed field is qty
4. Unit Cost: the average unit cost for Current Year       UnitCost = [CurrentCost]/[InvoicedQty]
5. BL Unit Cost:  the average unit cost for Prior Year       UnitCost = [CurrentCost]/[InvoicedQty]
6. Unit PPV: The difference between the average cost of an item this year vs last year.  UnitPPV = [UnitCost]-[BLUnitCost]
7. PPV: The total cost difference between the items purchased this year, applied to those purchased this year. PPV = [UnitPPV]*[InvoicedQty]
 
I know its something to do with my SUMX and Calculate in the measures which lead into the PPV measure, but I haven't been able to figure it out.  I would greatly appreciate any help. 
0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors