Forum Discussion
Final client status by grouping on selected date range
- Anonymous7 years ago
Hello all,
I have found solution to my problem. Here is the code:
CountOfMaxStatus = COUNTROWS( FILTER ( TestData; TestData[TimeStamp] = CALCULATE ( MAX ( TestData[TimeStamp] ); FILTER(ALL(TestData);TestData[Client] = EARLIER ( TestData[Client])); FILTER(ALL(TestData);TestData[TimeStamp]>=MIN(DateTimeDimension[TimeStamp])); filter(ALL(TestData);TestData[TimeStamp]<=MAX(DateTimeDimension[TimeStamp])) ) ))Here is link to the pbix file if you want to see it in the action: http://www.filedropper.com/maxstatusmeasure
Thanks AlB and v-lili6-msft for the help.
AlBThe measure your provided shows the max status for the whole period. If date slicer de-selects this max interaction, it will disapear and will not get recalculated. Maybe I am bad at explaining what I want to achieve, so let me illustrate - we have a client with 3 interactions:
| Client | InteractionID | Date | OldStatus | NewStatus |
| xyz | xyz1 | 01.dec | A | B |
| xyz | xyz2 | 03.dec | B | C |
| xyz | xyz3 | 05.dec | C | D |
If the date slicer has selected 12.01 - 12.05, the max interaction in this range is xyz3 and the respective max status = "D", therefore I need the output to be like this:
| Measure | Value |
| B | 0 |
| C | 0 |
| D | 1 |
However, now suppose I adjust date slicer to 12.01 - 12.04 The max interaction in this range is xyz2 and the respective max status = "C", therefore I need the output to look like this:
| Measure | Value |
| B | 0 |
| C | 1 |
| D | 0 |
This is what I am trying to achieve. I think that your measure is close to what I need, but I lack the knowledge to tweak it.
Hey Anonymous what's up
I haven't yet had time to look in detail at your latest post but what is the status on this? Have you made any progress?
- Anonymous7 years agoNot applicable
Hi AlB, I haven't had time to work on this recently. Should I happen to find the solution, I will definitely share it.