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
Anonymous
Not applicable

track status change month to month

Good morning. 

 

 

I'm left with a bit of a problem. I'm trying to track status changes each month in the delinquency status of loans. The work that i'm trying to build off of was created in mosaic by someone else and passed off to me to create in PBI.  

    positive and negative rolls reference.jpg

 

I have fields for snapshot dates that are always at the end of the month, the status of the loan, a binary field for if its the current month, and a count based on how far back the snapshot date is from the current month. I honestly have no idea how to begin to write the Dax for this and any help would be greatly appreciated. 

 

 

snapshot_dateloan_numberdelinquency_statusmonths_backis_current_month
7/31/20191111111221current01
6/30/2019111111122130 days10
5/31/2019111111122160 days20
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Found a working solution. 
 
previous month value =
CALCULATE (
FIRSTNONBLANK ( 'rlms_monthend'[default_group_mba], 1 ),
FILTER (
'rlms_monthend',
EARLIER ( 'rlms_monthend'[loan_number] ) = 'rlms_monthend'[loan_number]
&& DATEDIFF (
EARLIER ( 'rlms_monthend'[snapshot_date] ),
'rlms_monthend'[snapshot_date],
MONTH
) = -1
)
)

View solution in original post

3 REPLIES 3
v-cherch-msft
Employee
Employee

Hi @Anonymous 

I cannot fully understand it.Please explain more about your expected output.Please follow the How to Get Your Question Answered Quickly to post your simplified assumed data and expected output.It would be better if you can upload the .pbix file to OneDrive and post the link here.

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I can't post the dataset. 

I'm creating a column for each of the default groupings. Theoretically, each of these columns will compare the loan number to the one in the row above it. If the loan number changes, it marks it. If it doesn't change, it then should evaluate if Current row's status is different from the status of the row above it. I'm trying to use earlier.... but i haven't been able to crack it yet. I get an error that EARLIER refers to an earlier row context which doesn't exist. This is my code at the moment. 


30_to_C =
IF (
EARLIER ( rlms_monthend[Loan_number] ) <> rlms_monthend[loan_number],
"New Loan",
IF (
EARLIER ( rlms_monthend[default_group_mba] ) = "30 days" & rlms_monthend[default_group_mba] = "curent",
"30 - C",
"-"
)
)
Anonymous
Not applicable

Found a working solution. 
 
previous month value =
CALCULATE (
FIRSTNONBLANK ( 'rlms_monthend'[default_group_mba], 1 ),
FILTER (
'rlms_monthend',
EARLIER ( 'rlms_monthend'[loan_number] ) = 'rlms_monthend'[loan_number]
&& DATEDIFF (
EARLIER ( 'rlms_monthend'[snapshot_date] ),
'rlms_monthend'[snapshot_date],
MONTH
) = -1
)
)

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.