Forum Discussion
Renewed Tenancy Value KPI
- 5 years ago
Hi Calvin69 ,
First create an index column;
Then create 2 columns as below:
_index = CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[Title]=EARLIER('Table'[Title])&&'Table'[TenantN]=EARLIER('Table'[TenantN])&&'Table'[StartDate]>EARLIER('Table'[StartDate])))Column = VAR _previousindex = CALCULATE ( MAX ( 'Table'[_index] ), FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 ) ) VAR _previousrent = CALCULATE ( MAX ( 'Table'[Rent] ), FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 && 'Table'[Title] = EARLIER ( 'Table'[Title] ) && 'Table'[TenantN] = EARLIER ( 'Table'[TenantN] ) ) ) RETURN IF ( 'Table'[Index] = _previousindex, IF ( 'Table'[Rent] > _previousrent, 'Table'[Rent], _previousrent ) )And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
Hi v-kelly-msft ,
Logic should be as follow:
When a start date for a Location"Title" is changed to Greater value and the Client"Tenant Inclusive" is still the same comparing it with previous (Location "Title") entries show the "Rent" value.
Thanks for looking into this 🙂
H
Hi Calvin69 ,
First create an index column;
Then create 2 columns as below:
_index = CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[Title]=EARLIER('Table'[Title])&&'Table'[TenantN]=EARLIER('Table'[TenantN])&&'Table'[StartDate]>EARLIER('Table'[StartDate])))
Column =
VAR _previousindex =
CALCULATE (
MAX ( 'Table'[_index] ),
FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 )
)
VAR _previousrent =
CALCULATE (
MAX ( 'Table'[Rent] ),
FILTER (
'Table',
'Table'[Index]
= EARLIER ( 'Table'[Index] ) - 1
&& 'Table'[Title] = EARLIER ( 'Table'[Title] )
&& 'Table'[TenantN] = EARLIER ( 'Table'[TenantN] )
)
)
RETURN
IF (
'Table'[Index] = _previousindex,
IF ( 'Table'[Rent] > _previousrent, 'Table'[Rent], _previousrent )
)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
- Calvin694 years ago
Helper III
- v-kelly-msft4 years ago
Community Support
Hi Calvin69 ,
It's fine.Glad to help.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!