Count periods of emp occurrences for different types over consecutive days as 1

This was previously answered but another issue came up.

it worked fine until there were consecutive dates of different types of comments. the total should be 6 but it counted 5.50 because it thought 5/7 and 5/8 were the same types of occurence.
Please advise and thank you in advance. Also, in your original logic i was not sure about
[cumulative Days Count] so I used the original logic for [cumulative Days Count]. Thank you so much
The original solution is in the calculated column [ROLLING 12 MTH OCCURENCES]

TIME & ATTENDANCE_SAMPLE_CODE.xlsx (13.7 KB) TIME_ATTENDANCE_OCC_SAMPLE.pbix (43.0 KB)

Hi @lizbethl4

You have not provided reference to Original Requirement/Solution.

Thanks
Ankit J

Hi @lizbethl4, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.
  • When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.

image

  • Use the proper category that best describes your topic
  • Provide as much context to a question as possible.
  • Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.

Hi @lizbethl4, we’ve noticed that no response has been received from you since the 16th of April. We are waiting for what @ankit mentioned above, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details. In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Hi Ankit,
see the original solution below: it met requirements except when there were 2 types of comment ID
on consecutive days. I need to only count consecutive days as 1 occurrence when it is the same comment.

original solution
For better help, it is recommended to share test data in a pibx file.
Following the logic of the previous post, it will be something like this:

Cumulative Point = 

VAR vCurrentDate = 'Test Data'[Charge Date]
VAR _Ini = 'Test Data'[Cumulative Days Count] - 1
VAR _StartDate = DATEADD('Test Data'[Charge Date],-_Ini,DAY)
VAR vCurrentID = 'Test Data'[Employee ID]

VAR vNextTbl =
    FILTER ( 'Test Data', 'Test Data'[Charge Date] = vCurrentDate + 1 && 'Test Data'[Employee ID] = vCurrentID )
VAR vRangeTbl =
    FILTER ( 'Test Data', 'Test Data'[Charge Date] >= _StartDate && 'Test Data'[Charge Date]<= vCurrentDate  && 'Test Data'[Employee ID] = vCurrentID )

VAR _Acum = CALCULATE(SUM('Test Data'[Points]), ALL('Test Data'),vRangeTbl)
RETURN
    _Acum