Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago

Totals in Matrix not adding correctly

Hi all,
I have a matrix with a measure in the value, the data is correct but the column totals are wrong. The measure that's included in the value is as follows: 

TotalControls =
DISTINCTCOUNT('FactControlRelations'[Guid])
The table FactControlRelations is a historical table containing multiple instances of the same item with different relations with other tables as well as a date column. I have no idea how to make it correct.
I also have another measure value in the matrix as follows:
Δ PM Controls =
VAR delta = [ComparisonTotalControls]
RETURN
IF(delta < 0,
    ROUND(delta, 0),
    IF(delta > 0,
        "+" & ROUND(delta, 0)
    )
)
ComparisonTotalControls =
[TotalControls] - [PriorMonthTotalControls]
PriorMonthTotalControls =
CALCULATE(
    [TotalControls],
    DATEADD('DimDate'[Date], -1, MONTH)
)
Any idea on how to make it work?

2 Replies