Forum Discussion

Foxxon28's avatar
Foxxon28
Icon for Helper I rankHelper I
2 years ago
Solved

Cumulative Sales Sum based on Specific Column and Rule

Dear reader,   I have a dataset as follows:   Year Date ( Once Per Month ) Month_progress Sales 2024 30-11-2023 -1 10 2024 31-12-2023 0 20 2024 31-01-2024 1 30 2023 30...
  • Greg_Deckler's avatar
    Greg_Deckler
    2 years ago

    Foxxon28 PBIX is attached below signature.

    Sales Measure = 
        VAR __MP = MAX('Table'[Month_progress])
        VAR __Year = MAX('Table'[Year])
        VAR __Table = FILTER(ALL('Table'), [Month_progress] <= __MP && [Year] = __Year)
        VAR __Result = SUMX(__Table, [Sales])
    RETURN
        __Result