Cumulative total issue

I have a DAX to calculate cumulative total. it is giving correct result if there are no filters or slicers applied. I have year slicer, when I click on that, 2019 year gives me correct result for every month but when I click 2018, it is giving me same result for every month. I have only data from September to December for 2018.

Cumulative District Logins = IF([Total District Logins]= 0, BLANK(),
                                    CALCULATE([Total District Logins] ,
                                        FILTER(ALLSELECTED(Ed360Usage[Logged in date].[Date]),
                                               Ed360Usage[Logged in date].[Date]<=MAX(Ed360Usage[Logged in date].[Date])))  )                    

2019 Data:

2018 data

I do not have date table. I did try using data table but Date table would not connect properly to my fact table. None of the fact table dates matching my Date table. I’m not able to figure out why:



Welcome to the forum!

If you create a date table per the instructions below that spans at least the min and max dates of your fact table, mark it as a date table and then create the proper 1:many relationship between the date table and the fact table, I think that will solve your problem.

  • Brian
1 Like

Thank you for the suggestions. I will try this. Thanks for the time.


Glad to help. Just give a shout if you have any problems after trying that.

  • Brian

Hi @pshetty

Welcome to the forum.

The possible issues could be date format not similar in both the tables, or your date table contains dates ( example 1/1/2018 to 12/1/2018) and your data is not present for these dates.
Please expand your dates table to match with your data-set.
Else refer to below video for more clarity.

1 Like

Date table and fact table dates have same format. please find attached screenshot. Still it is not matching when I put them into one table:

Dates in Separate table visual:

Dates in same table visual:

Thanks for the video. I’m going to try all of the suggestions today to figure this out.

Cool do try it. If you still face any issue, then please share pbix file and I can look into it.

Thank you @BrianJ and @kkrj.ankit . Both of your suggestions combined helped me figure out this. The issues I had with date was, my fact table date- data type should have been changed to “Date” instead of “Date Time” at the time of Transfer Data. I changed Data type after loading data. Apparently it does not work. Also, In Cumulative calculation, I was referring Month instead of date. Month of a date does not work. it has to be date field as we are calculating based on date. Lot of lessons learnt. Thank you.