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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bonjourposte
Advocate III
Advocate III

A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter exp

Hi all, I'm getting this error message with my measure, trying to figure out the number of Renewals and Extensions we've done in the past year.  What does it want me to change?
 
bonjourposte_2-1730136150972.png

 


 


 

 
NumRenewals2 =
VAR MatDate = MAX(LOANHISTSorted[MAT_DATE])
VAR CurrentLoanStatus = MAX(LOANHISTSorted[LOAN_STATUS])
VAR CurrentLoanTerm = MAX(LOANHISTSorted[CURR_LOAN_TERM])
VAR CurrentAmzMos = MAX(LOANHISTSorted[CURR_AMZ_MONTHS])

VAR PREV_MAT_DATE = MAX(LOANHISTSorted[PREV_MAT_DATE])
VAR PREV_LOAN_STATUS = MAX(LOANHISTSorted[PREV_LOAN_STATUS])
VAR PREV_LOAN_TERM = MAX(LOANHISTSorted[PREV_LOAN_TERM])
VAR PREV_AMZ_MOS = MAX(LOANHISTSorted[PREV_AMZ_MONTHS])
VAR PREV_START_DATE = MAX(LOANHISTSorted[PREV_START_DATE])



RETURN
CALCULATE(
    COUNTROWS(LOANHISTSorted),
        IF(
            AND(
                MatDate <> [PreviousMatDate],
                CurrentLoanStatus <> "Commitment" &&
                PREV_LOAN_STATUS <> "Cancelled"&&
                PREV_LOAN_STATUS <> "PAIDINFULL"
            ),
        SWITCH(
            TRUE,
            PREV_START_DATE > MatDate, "Renewal",
            PREV_LOAN_TERM <> CurrentLoanTerm, PREV_AMZ_MOS = CurrentAmzMos, "Extension"
            )
        )
    )
1 ACCEPTED SOLUTION
PijushRoy
Super User
Super User

Hi @bonjourposte 
Can you please check the below DAX, please let me know if not works

NumRenewals2 = 
VAR MatDate = MAX(LOANHISTSorted[MAT_DATE])
VAR CurrentLoanStatus = MAX(LOANHISTSorted[LOAN_STATUS])
VAR CurrentLoanTerm = MAX(LOANHISTSorted[CURR_LOAN_TERM])
VAR CurrentAmzMos = MAX(LOANHISTSorted[CURR_AMZ_MONTHS])

VAR PREV_MAT_DATE = MAX(LOANHISTSorted[PREV_MAT_DATE])
VAR PREV_LOAN_STATUS = MAX(LOANHISTSorted[PREV_LOAN_STATUS])
VAR PREV_LOAN_TERM = MAX(LOANHISTSorted[PREV_LOAN_TERM])
VAR PREV_AMZ_MOS = MAX(LOANHISTSorted[PREV_AMZ_MONTHS])
VAR PREV_START_DATE = MAX(LOANHISTSorted[PREV_START_DATE])

RETURN
    CALCULATE(
        COUNTROWS(LOANHISTSorted),
        FILTER(
            LOANHISTSorted,
            MatDate <> PREV_MAT_DATE &&
            CurrentLoanStatus <> "Commitment" &&
            PREV_LOAN_STATUS <> "Cancelled" &&
            PREV_LOAN_STATUS <> "PAIDINFULL" &&
            (
                (PREV_START_DATE > MatDate) || 
                (PREV_LOAN_TERM <> CurrentLoanTerm && PREV_AMZ_MOS = CurrentAmzMos)
            )
        )
    )

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

3 REPLIES 3
PijushRoy
Super User
Super User

Hi @bonjourposte 
Can you please check the below DAX, please let me know if not works

NumRenewals2 = 
VAR MatDate = MAX(LOANHISTSorted[MAT_DATE])
VAR CurrentLoanStatus = MAX(LOANHISTSorted[LOAN_STATUS])
VAR CurrentLoanTerm = MAX(LOANHISTSorted[CURR_LOAN_TERM])
VAR CurrentAmzMos = MAX(LOANHISTSorted[CURR_AMZ_MONTHS])

VAR PREV_MAT_DATE = MAX(LOANHISTSorted[PREV_MAT_DATE])
VAR PREV_LOAN_STATUS = MAX(LOANHISTSorted[PREV_LOAN_STATUS])
VAR PREV_LOAN_TERM = MAX(LOANHISTSorted[PREV_LOAN_TERM])
VAR PREV_AMZ_MOS = MAX(LOANHISTSorted[PREV_AMZ_MONTHS])
VAR PREV_START_DATE = MAX(LOANHISTSorted[PREV_START_DATE])

RETURN
    CALCULATE(
        COUNTROWS(LOANHISTSorted),
        FILTER(
            LOANHISTSorted,
            MatDate <> PREV_MAT_DATE &&
            CurrentLoanStatus <> "Commitment" &&
            PREV_LOAN_STATUS <> "Cancelled" &&
            PREV_LOAN_STATUS <> "PAIDINFULL" &&
            (
                (PREV_START_DATE > MatDate) || 
                (PREV_LOAN_TERM <> CurrentLoanTerm && PREV_AMZ_MOS = CurrentAmzMos)
            )
        )
    )

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hi @PijushRoy , I got it to work!  Thanks for your help.

 

NumRenewals =

VAR MatDate = MAX(LOANHISTSorted[MAT_DATE])

VAR PREV_START_DATE = MAX(LOANHISTSorted[PREV_START_DATE])

VAR CurrentLoanStatus = MAX(LOANHISTSorted[LOAN_STATUS])

 

RETURN

CALCULATE(

    COUNTROWS(LOANHISTSorted),

    FILTER(

            LOANHISTSorted,

                LOANHISTSorted[MAT_DATE] <> LOANHISTSorted[PREV_MAT_DATE] &&

                CurrentLoanStatus <> "Commitment" &&

                LOANHISTSorted[PREV_LOAN_STATUS] <> "Cancelled" &&

                LOANHISTSorted[PREV_LOAN_STATUS] <> "PAIDINFULL" &&

                LOANHISTSorted[CURR_START_DATE] > LOANHISTSorted[PREV_MAT_DATE])

Thanks, it didn't work, but it's the closest I've gotten.  

 

I took out the line about Extensions because I'll do the Extensions in another matrix.  This one will just be Renewals.  

  

bonjourposte_0-1730144300884.png

 

It should look like the first matrix, but it gives me the second one.

bonjourposte_1-1730144453641.png

 

 
NumRenewals2 =
VAR MatDate = MAX(LOANHISTSorted[MAT_DATE])
VAR CurrentLoanStatus = MAX(LOANHISTSorted[LOAN_STATUS])
VAR CurrentLoanTerm = MAX(LOANHISTSorted[CURR_LOAN_TERM])
VAR CurrentAmzMos = MAX(LOANHISTSorted[CURR_AMZ_MONTHS])

 

VAR PREV_MAT_DATE = MAX(LOANHISTSorted[PREV_MAT_DATE])
VAR PREV_LOAN_STATUS = MAX(LOANHISTSorted[PREV_LOAN_STATUS])
VAR PREV_LOAN_TERM = MAX(LOANHISTSorted[PREV_LOAN_TERM])
VAR PREV_AMZ_MOS = MAX(LOANHISTSorted[PREV_AMZ_MONTHS])
VAR PREV_START_DATE = MAX(LOANHISTSorted[PREV_START_DATE])




RETURN
CALCULATE(
    COUNTROWS(LOANHISTSorted),
    FILTER(
            LOANHISTSorted,
                MatDate <> PREV_MAT_DATE &&
                CurrentLoanStatus <> "Commitment" &&
                PREV_LOAN_STATUS <> "Cancelled" &&
                PREV_LOAN_STATUS <> "PAIDINFULL" &&
                PREV_START_DATE > MatDate
        )
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.