Forum Discussion
Check if subscription is new or modification in subscription
- 6 years ago
Hi , Anonymous
If I didn't misunderstand your meaning,you can try the following steps:
First , you need to sort the table by “Relationshipnumber” and “starting date”.
Then, a index column is needed to be inserted into the table to help you create DAX.( You can right-click to hide the created index column if you don't need to display it )
Finally , you can create calculate columns “Start Subscription modification1” and “End Subscription modification1” like that :
Start Subscription modification1 = var ed = 'Table'[Starting date] var ind = 'Table'[Index]-1 var sti = CALCULATE(MAX('Table'[End date] ),FILTER('Table','Table'[Index] = ind)) var days=DATEDIFF(sti,ed,DAY) var val=IF(days<=14&&days>=0,1) return IF(days<>BLANK(),val,BLANK() )End Subscription modification1 = var ed = 'Table'[End date] var ind = 'Table'[Index]+1 var sti = CALCULATE(MAX('Table'[Starting date]),FILTER('Table','Table'[Index] = ind)) var days=DATEDIFF(ed,sti,DAY) var val=IF(days<=14&&days>0,1) return IF(days<>BLANK(),val,BLANK())Here is a sample I made:
Best Regards,
Eason
Community Support Team _ Eason Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi , Anonymous
If I didn't misunderstand your meaning,you can try the following steps:
First , you need to sort the table by “Relationshipnumber” and “starting date”.
Then, a index column is needed to be inserted into the table to help you create DAX.( You can right-click to hide the created index column if you don't need to display it )
Finally , you can create calculate columns “Start Subscription modification1” and “End Subscription modification1” like that :
Start Subscription modification1 =
var ed = 'Table'[Starting date]
var ind = 'Table'[Index]-1
var sti = CALCULATE(MAX('Table'[End date] ),FILTER('Table','Table'[Index] = ind))
var days=DATEDIFF(sti,ed,DAY)
var val=IF(days<=14&&days>=0,1)
return
IF(days<>BLANK(),val,BLANK()
)End Subscription modification1 =
var ed = 'Table'[End date]
var ind = 'Table'[Index]+1
var sti = CALCULATE(MAX('Table'[Starting date]),FILTER('Table','Table'[Index] = ind))
var days=DATEDIFF(ed,sti,DAY)
var val=IF(days<=14&&days>0,1)
return
IF(days<>BLANK(),val,BLANK())
Here is a sample I made:
Best Regards,
Eason
Community Support Team _ Eason Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Thank you very much, this was exactly what I needed!