Forum Discussion

newbie9292's avatar
newbie9292
Helper II
5 years ago

Help with Cummulative data DAX query

I want to show Cummulative data in my visual : 

Kum_AE_Combined_2021 = CALCULATE (
SUM(AE_Weekly[AuftrEing]),
FILTER (
ALL(Date_dim[Date]),
Date_dim[Date] <= MAX (Date_dim[Date]) && YEAR(Date_dim[Date])= 2021
)
)
But it's only showing me the total data for every month.

Could someone help me what I am doing wrong here?

8 Replies

  • newbie9292 , In this case the month should come from date table in visual , make sure that is true

    Not sure on need of filter 2021

    Date_dim should be marked as date

     

    Kum_AE_Combined_2021 = CALCULATE (
    SUM(AE_Weekly[AuftrEing]),
    FILTER (
    ALL(Date_dim[Date]), // or use allseleceted 
    Date_dim[Date] <= MAX (Date_dim[Date])
    )
    )

     

    use datesytd for yearly

    CALCULATE (
    SUM(AE_Weekly[AuftrEing]),datesytd('Date_dim'[Date]))

    • newbie9292's avatar
      newbie9292
      Helper II

      Hello!

      Thanks for your reply. It's not working. Still showing me the same values.

      • newbie9292's avatar
        newbie9292
        Helper II

        The above is from the DAX
        Kum_AE_Combined_2021 = CALCULATE(SUM(AE_Weekly[AuftrEing]),datesytd('AE_Weekly'[Date]))
         
        I have date_dim table which is my calender table which is connected to the  AE_Weekly[AuftrEing] table.
         
    • newbie9292's avatar
      newbie9292
      Helper II

      The query is now working partially. When I select the slicer individually it correctly shows the cummulated data. But when I select both years in the slicer it doesn't shows the 2020 cummulated data  correctly.

  • The query is now working partially. But when I filter 2020 or 2021 individually it shows the cummulated data correctly but doesn't shows the correct cummulated data when both years are selected as shown below.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi newbie9292 ,

     

    Please share the pbix file without sensitive data to help us clarify your scenario.

     

    Best Regards,
    Eyelyn Qin