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.
Formula:
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:
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.
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.
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.