Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TriveniN
Helper II
Helper II

How to get below result

Hi,

 

Requirment

If property is having both 'current' and 'pending' lease status then we need to get 'Current'

If property is having both 'pending' lease status then we need to get 'pending'.

below is the sample data

TriveniN_0-1704284460043.png

Expected Output ismentioned in Heilghted values below

TriveniN_1-1704284627945.png

 

 

2 REPLIES 2
Ahmedx
Super User
Super User

pls try htis

Screenshot_1.png

 Hi,

Thanks for quick response.

Requirment : If user select next months like below screenshot and 

If property is having both 'current' and 'pending' lease status then we need to get 'Current'

If property is having only 'pending' lease status then we need to get 'pending' based on month selection.

TriveniN_1-1704635151089.png

Used below logic 

AllMnts_Count of Propertiess =
VAR _minD = CALCULATE(MIN(Datecalendar[TheDate]))
VAR _maxD = CALCULATE(MAX(Datecalendar[TheDate]))
VAR _Day = IF(MONTH(_maxD) IN {1,3,5,7,8,10,12}, 31, IF(MONTH(_maxD) IN {4,6,9,11}, 30, 28) )
VAR _minDate = DATE(YEAR(_minD),MONTH(_minD),1)
VAR _maxDate = DATE(YEAR(_maxD),MONTH(_maxD),_Day)
RETURN
CALCULATE(DISTINCTCOUNT(LEASE_EXPIRATION[Property_ID__c]),
NOT LEASE_EXPIRATION[Yardi_Lease_Status__c] in { "Canceled","Past"}
&& LEASE_EXPIRATION[Lease_Sign_Date__c] <> BLANK()
&& LEASE_EXPIRATION[MTM_Start_Date__c] = BLANK()
            ,
FILTER(LEASE_EXPIRATION,
LEASE_EXPIRATION[Lease_End_Date__c] >= _minDate && LEASE_EXPIRATION[Lease_End_Date__c] <= _maxDate) )

 

I will provide detailed data for requirment.

Please look below detailed data.

Property IDMarketLease EndDateMTM StartDateRenewal DateLease StatusLease_Sign_Date__cMTM_End_Date__cProperties
ATL00001Atlanta1/4/2024 0:00 11/6/2023 0:00Current12/29/2021 0:00 1
ATL00001Atlanta1/5/2026 0:00  Pending12/29/2021 0:00 1
ATL00033Atlanta2/17/2024 0:00  Current2/12/2022 0:00 1
ATL00033Atlanta2/17/2025 0:00  Pending2/12/2022 0:00 1
ATL00430Atlanta4/1/2025 0:00  Pending12/23/2023 0:00 1
CLT00230Charlotte1/26/2024 0:00 11/15/2023 0:00Current1/18/2023 0:00 1
CLT00230Charlotte4/26/2025 0:00  Pending1/18/2023 0:00 1
SAT00220San Antonio3/11/2025 0:00  Current11/30/2023 0:00 1

 

Expected Result is heighlethed in yellow color.

TriveniN_2-1704635438983.png

 

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.