Forum Discussion
Countrows with multiple conditions
Hi,
Please download the sample pbix from gdrive.
https://drive.google.com/file/d/1g0__wX8wCgRGSLMwzDWuzR8a5zWki09n/view?usp=sharing
Anonymous , Checked out the pbix. But not able to get the wrong data as it not the same(sample data) as the one you shared on the post.
Please share the expected output
Also try
countx(values(Sheet[SITE_NO]) ,calculate(COUNTROWS(Sheet1),
FILTER(
Sheet1,
[SITE_NO]=max([SITE_NO]) &&
[START_DT]>max([START_DT]) &&
[EVENT_CODE]=max([EVENT_CODE]) &&
DATEDIFF(min(EARLIER([END_DT])),max([START_DT]),SECOND)<10) , allselected(Sheet1)
))
- Anonymous5 years agoNot applicable
Hi amitchandak
Thanks for swift replies. I think I should clarify more.
- Events dax measure merges and counts the events that has same site number, same event code and the difference of less than or equal to 10s between current and previous event.
- Event V2 dax measure does the same whereas the difference is 2hr.
Basically, I am trying to combine the repeated events, however they are recorded as separate rows.
My expected output for Event V2 would be:
- for Site No 4087 : 1 (refer to 1st pic, since its event start time and previous end time are <2hr)
- for Site No 3841: 6 (refer to 2nd pic and the colour lines)