Forum Discussion

Saqibmughal00's avatar
1 year ago
Solved

Help in counting cumulative for each category separately

Hi,    I am trying to create a cumulative value for each category as pictured. I tried below DAX but its not giving me cumulative but a weekly data again. " Cumulative C&I Earned Hours = CALCUL...
  • v-saisrao-msft's avatar
    v-saisrao-msft
    1 year ago

    Hi Saqibmughal00, 
    Thank you for reaching out to the Microsoft fabric community forum. Thank you maruthisp, for your input on this issue 
     
    After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.   

      

    Dax Measure: 

    Cumulative Value by Description = 
    VAR CurrWeek = MAX(CIPFAnalysis[Week Ending])
    VAR CurrDesc = SELECTEDVALUE(CIPFAnalysis[Description])
    RETURN
    CALCULATE(
        SUM(CIPFAnalysis[Value]),
        FILTER(
            ALLSELECTED(CIPFAnalysis),
            CIPFAnalysis[Week Ending] <= CurrWeek &&
            CIPFAnalysis[Description] = CurrDesc
        )
    )
    

    Output: 

    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly. 
     
    Thank you.