Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Solved! Go to Solution.
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)
)
)
)
Proud to be a 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)
)
)
)
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.
It should look like the first matrix, but it gives me the second one.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!