Forum Discussion
Cumulative count split by attribute's values
Hello community,
I have been trying to find a solution to the following problem. This is the scenario:
| Projekt | ReqID | Status | ModifiedDate |
| C | 12345 | AGREED | 02.07.2022 00:00:00 |
| C | 112233 | PARTLY_AGREED | 03.07.2022 00:00:00 |
| C | 112233 | NOT_AGREED | 04.07.2022 00:00:00 |
| C | 112233 | AGREED | 05.07.2022 00:00:00 |
| C | 9876 | AGREED | 06.07.2022 00:00:00 |
This table contains 3 requirements, one of which is being changed 3 times on consecutive days. I am now trying to calculate the number of ReqIDs cumulated per day, and split by state, using this measure:
# of ReqID = CALCULATE( DISTINCTCOUNTNOBLANK('Tabelle1'[ReqID]), FILTER ( ALLSELECTED('Tabelle1'), 'Tabelle1'[ModifiedDate] <= MAX ('Tabelle1'[ModifiedDate]) ))
This would be my expected result:
| total of ReqID | AGREED | PARTLY_AGREED | NOT_AGREED | |
| 02. Jul | 1 | 1 | ||
| 03. Jul | 2 | 1 | 1 | |
| 04. Jul | 2 | 1 | 1 | |
| 05. Jul | 2 | 2 | ||
| 06. Jul | 3 | 3 |
Unfortunately, this is the result:
Why am I getting a count of 2 for 3rd and 4th for the states? How can I avoid this?
Thanks a lot for your help!
Regards,
Marc
6 Replies
- AnonymousNot applicable
Hi Anonymous
Should be the ALLSELECTED, you can do like this
# of ReqID = CALCULATE(COUNTROWS(VALUES(Tabelle1[ReqID])), Tabelle1[ModifiedDate]<=MAX(Tabelle1[ModifiedDate]))- AnonymousNot applicable
Thanks a lot for your answer, Vera.
There is still something missing though: now the sums in lines don't add up. For 3rd and 4th, there should be a 1 for AGREED, too.
(Sorry, I can't get the formatting nice on my "expected results" table.)
- AnonymousNot applicable
Hi Anonymous
If the AGREED should have 1 as cumulative, then why the other two do not have? The total still doesn't add up...I had a another date table, did not use the date column in the same table.
You need to explain your logic