Forum Discussion

MohamedSalih_12's avatar
MohamedSalih_12
Frequent Visitor
1 year ago
Solved

Wrong Total in SUMX

I have two fact tables 

1. Historic Stock prices downloaded from Google sheets with 3 Columns Date, Ticker, Unit Price

2. Stock Buy transactions table with 4 Columns Date, Ticker, Quantity, Unit Price

3. Below is the matrix which contains Date from Calendar Table, Ticker from Bridge Table, Quantity from Transaction table, Last Unit Price from Historical Prices Table with REMOVEFILTERS('Calendar'[Date] applied, all is well so far

The issue is with the measure [Amount 2] = SUM('Transaction'[Quantity])* [Last Unit Price]. It works well in the row context of Tickers, but in the context of Date (see 5/7/2024), it multiplies total Quantity with total of the Unit Prices (i.e 392,036.76).

But I want in the Date rows summation of product of each ticker which has to be (95,027.12)

 

I hope I explained the situation well, looking for a corrected measure.

 

  • lbendlin's avatar
    lbendlin
    1 year ago

    Make the relationship inactive. Use USERELATIONSHIP in your measure.

6 Replies