Forum Discussion
Countrows with multiple conditions
Hi Anonymous ,
I think you need to show the expected result of your sample data.
I use your sample data to create a calculated column, hope that's what you want, please try.
Column = SUMX(Sheet1,IF([SITE_NO]=EARLIER([SITE_NO]) &&
[START_DT]>EARLIER([START_DT]) &&
[EVENT_CODE]=EARLIER([EVENT_CODE]) &&
DATEDIFF(EARLIER(Sheet1[END_DT]),Sheet1[START_DT],SECOND) <= 10,
1,
0))
Aiolos Zhao
- Anonymous5 years agoNot applicable
Hi Anonymous
Please read message 5 for expected output. The sample data size is so tiny compared to the one I am working on.
I am afraid I won't be able to add the calculated column for years worth of data (approx. 10M rows). That's why I wanted DAX measure to combine repeated events with above conditions.
- Anonymous5 years agoNot applicable
Hi Anonymous ,
What's your the expected result of your sample data, in your sample data, the Site No is A / B / C, NO 4780 and 3841
And I use the measure for SITE NO = B and EVENT_CODE = OB, the result is 24 and 27.
Aiolos Zhao
- Anonymous5 years agoNot applicable
Hi Anonymous
By site 4780 and 3841, I was referring to screenshots in my message 1. Anyway, as for sample data, the expected output (site B, event OB) should be 27. I think you created the right measure.