Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Cumlative Total not adding up correctly

Hi all,

 

I am trying to count the number of documents that have been created and completed in a given/selected day and look at it for each hour. I want to count the number of documents at each hour and it be a cumlative total.

 

CreatedCount = 
CALCULATE(
    COUNTA(IMSDocuments[Creation Date]) + 0,
    FILTER(ALL(IMSDocuments), IMSDocuments[CreationHour] <= MAX(IMSDocuments[CreationHour])),
    USERELATIONSHIP(Times[Time], IMSDocuments[CreationHour]),
    USERELATIONSHIP(Dates[Date], IMSDocuments[Creation Date])
)

Currently my DAX looks like this. I have the ... <= MAX(...) in the expression, but it still doesn't add up right. For 12th Feb 2018, created should total 120 and completed should total 93.

 

I have a scaled back version of my report which still has all the necessary relationships.

https://drive.google.com/file/d/1nryyr0IdUjjQTQi81v_G6RyS2d_DI-A2/view?usp=sharing

 

Can anyone see where I am going wrong?

 

Thanks in advance!!

 

2 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      That's it! Amazing!

       

      Thank you!