Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Hierarchy level total

Hello,

I am facing issue with hierarchy level total.  It is showing incorrect total at top level for one field only.

 Hierarchies- Rcode-Mcode-Hubname-dealer name

Till 'Mcode' it is showing correct total only at 'Rcode' it is incorrect.

Measure for that field is-

Total units-

var Lastmaxdate = MAX(FactPJP[DateOfQuarter])

var lvalue= CALCULATE (
SUM(FactPJP[TotalNumberOfUnitsInMonth])
,FactPJP[DateOfQuarter] = LastTime,REMOVEFILTERS(DimDate)))

RETURN lvalue

please help me with that.

2 Replies

  • Anonymous m are you trying cumulative tota, then you should try like

     

    Total units=

    var lvalue= CALCULATE (
    SUM(FactPJP[TotalNumberOfUnitsInMonth])
    ,filter(all(DimDate),DimDate[DateOfQuarter] = max(DimDate[date])))
    RETURN lvalue

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the solution.