Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Summing value from a matrix

Hi created this measure and I am using it in my matrix:  ReallocateClassesPerDay = VAR MinT = SELECTEDVALUE(MinThreshold[MinThreshold]) VAR MaxT = SELECTEDVALUE(MaxThreshold[MaxThreshold]) VAR T...
  • v-hashadapu's avatar
    1 year ago

    Hi Anonymous , Thank you for reaching out to the Microsoft Community Forum.

     

    Build a new measure that recreates that row-level context manually using SUMMARIZE, and then sums the results with SUMX. Example:

    TotalReallocateClasses =
    VAR vTable =
    SUMMARIZE(
    Sheet1,
    Sheet1[acad_org],
    Sheet1[day_of_week],
    "__Reallocation", [ReallocateClassesPerDay]
    )
    RETURN
    SUMX(vTable, [__Reallocation])

     

    This forces DAX to recalculate [ReallocateClassesPerDay] for every (acad_org, day_of_week) pair exactly as it appears in the matrix and then adds them up to give the true total. After writing this measure, drop it into a card visual to display the correct total number of classes that need to be reallocated.

     

    If this helped solve the issue, please consider marking it “Accept as Solution” so others with similar queries may find it more easily. If not, please share the details, always happy to help.
    Thank you.