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 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!
Your answer has been very usefull, but I have a problem yet. I have the same date in differents rows, for example:
column1 column2 column3
28/09/2018 data1 data2
28/09/2018 data3 data4
28/09/2018 data4 data6
28/09/2018 data5 data8
29/09/2018 data9 data10
29/09/2018 data11 data12
Would you know how to apply yout last message to this?
Thanks!
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Taznalem,
Please try to change the "Added custom" step and the measure.
if [Index] = 0 then 1 else if #"Changed Type"{[Index] - 1}[Date] + #duration(1, 0, 0, 0) = [Date] or
#"Changed Type"{[Index] - 1}[Date] = [Date] then 1 else 0Measure = MAXX ( SUMMARIZE ( 'Table1', 'Table1'[Index], "non-stop", DISTINCTCOUNT ( 'Table1'[Date] ) ), [non-stop] )Best Regards,
Dale- Taznalem7 years agoFrequent Visitor
I appreciate you commentary, but that is not a suitable solution, that is because:
1. When I create the Added custom with the formula:
if [Index] = 0 then
1
else if #"Changed Type"{[Index] - 1}[Date] + #duration(1, 0, 0, 0) = [Date] or #"Changed Type"{[Index] - 1}[Date] = [Date] then
1
else
0This create a column where is "1" when the date is the same date that the previous one or when it is a continous day:
Date Custom
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 1 20/09/2018 1 20/09/2018 1 25/09/2018 0 25/09/2018 1 25/09/2018 1 25/09/2018 1 25/09/2018 1 26/09/2018 1 26/09/2018 1 26/09/2018 1 27/09/2018 1 27/09/2018 1 27/09/2018 1 28/09/2018 1 28/09/2018 1 28/09/2018 1 01/10/2018 0 01/10/2018 1 01/10/2018 1 03/10/2018 0 03/10/2018 1 03/10/2018 1 04/10/2018 1 04/10/2018 1 06/10/2018 0 08/10/2018 0 08/10/2018 1 09/10/2018 1 09/10/2018 1 13/10/2018 0 13/10/2018 1 20/10/2018 0 20/10/2018 1 20/10/2018 1 21/10/2018 1 21/10/2018 1 22/10/2018 1 22/10/2018 1 2. Therefore, when I create the measure is always "1"
Thanks in advance
Alvaro
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Alvaro,
Did you check the demo in the attachment? Your input here is just one step of the solution.
Best Regards,
Dale