Forum Discussion

dbattin4's avatar
dbattin4
Frequent Visitor
1 year ago
Solved

SUMX giving zero total for a column in Table visual

I am looking at a table visual where the line totals are correct but the Grand Total is coming back as zero despite using SUMX   The measure is as follows PreviousMonthValue = VAR _current...
  • Selva-Salimi's avatar
    1 year ago

    Hi dbattin4 , try this updated measure:

     

    VAR _currentOpp = VALUES(Opportunities_ME[OpportunityNumber])
    VAR _currentDate = MAX(Opportunities_ME[IngestionDate_EOM])
    VAR _prevMonthEnd = EOMONTH(_currentDate, -1)
    VAR _lastAvailableDate = CALCULATE( MAX(Opportunities_ME[IngestionDate_EOM]), FILTER( ALL(Opportunities_ME), Opportunities_ME[OpportunityNumber] IN _currentOpp && Opportunities_ME[IngestionDate_EOM] <= _prevMonthEnd ) )
    VAR _ValueLM = CALCULATE(
         SUMX( FILTER( ALL(Opportunities_ME), Opportunities_ME[OpportunityNumber] IN _currentOpp && Opportunities_ME[IngestionDate_EOM] = _lastAvailableDate ),Opportunities_ME[EstimatedValueBase]) )+0
    RETURN
    _ValueLM
     
     
    If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.