Forum Discussion
How to create calculate spells ?
- 7 years ago
Hi Taznalem,
Please check out the demo in the attachment. The main steps are as follows.
1. Create an index that can identify the continuous days.
2. Create a measure.
Measure = MAXX ( SUMMARIZE ( 'Table1', 'Table1'[Index], "non-stop", COUNT ( 'Table1'[Training] ) ), [non-stop] )Best Regards,
Dale
Hi Alvaro,
Did you check the demo in the attachment? Your input here is just one step of the solution.
Best Regards,
Dale
I am sorry, you are right. I have forgotten send you the other column with the formula (I've renamed this column as "FinalIndex")
List.Accumulate(let currentIndex = [Index] in Table.SelectRows(#"Added Custom", each [Index] <= currentIndex)[Custom], 1, (state, val) => if val = 1 then state else state + 1)
Fecha FinalIndex
| 19/09/2018 | 1 |
| 19/09/2018 | 1 |
| 19/09/2018 | 1 |
| 19/09/2018 | 1 |
| 19/09/2018 | 1 |
| 19/09/2018 | 1 |
| 20/09/2018 | 2 |
| 20/09/2018 | 2 |
| 20/09/2018 | 2 |
| 25/09/2018 | 3 |
| 25/09/2018 | 3 |
| 25/09/2018 | 3 |
| 25/09/2018 | 3 |
| 25/09/2018 | 3 |
| 26/09/2018 | 4 |
| 26/09/2018 | 4 |
| 26/09/2018 | 4 |
| 27/09/2018 | 5 |
| 27/09/2018 | 5 |
| 27/09/2018 | 5 |
| 28/09/2018 | 6 |
| 28/09/2018 | 6 |
| 28/09/2018 | 6 |
| 01/10/2018 | 7 |
| 01/10/2018 | 7 |
| 01/10/2018 | 7 |
| 03/10/2018 | 8 |
| 03/10/2018 | 8 |
| 03/10/2018 | 8 |
| 04/10/2018 | 9 |
| 04/10/2018 | 9 |
| 06/10/2018 | 10 |
| 08/10/2018 | 11 |
| 08/10/2018 | 11 |
| 09/10/2018 | 12 |
| 09/10/2018 | 12 |
| 13/10/2018 | 13 |
| 13/10/2018 | 13 |
| 20/10/2018 | 14 |
| 20/10/2018 | 14 |
| 20/10/2018 | 14 |
| 21/10/2018 | 15 |
| 21/10/2018 | 15 |
| 22/10/2018 | 16 |
| 22/10/2018 | 16 |
I think that there is any kind of mistake in the measure because the number is still "1".
Thank you in advance
Alvaro
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Alvaro,
Which measure did you use? Since I have uploaded a demo, can you point out the issue in the demo? You already have a column [FinalIndex]. No issues are on my side. So I can't find out what the issue is on your side. Can you share your file?
Best Regards,
Dale