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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
salame
New Member

help with dax

I have this dataset: I need to create a sum amount and filter by month such that if the value is blank in that month I get the value of the last previous month that was nonblank.

 

Loan NoAmountDate
LNA-00331849315.3601/01/2025
LNA-00419109589.1612/10/2025
LNA-00631849315.3611/11/2025
LNA-0096369863.2520/11/2025

 

The result for LNA-009 per month to be as shown with December not blank but picks value for November:

Loan NoAmountmonth
LNA-0096369863.25November
LNA-0096369863.25December
1 ACCEPTED SOLUTION
v-karpurapud
Community Support
Community Support

Hi @salame 
Thank you for reaching out to Microsoft Fabric Community Forum.

Try with below DAX:

Amount_Latest = 
VAR LastAmount = 
    CALCULATE(
        SUM('loan collaterals'[Outstanding Amount]),
        FILTER(
            ALL('Ultimate Calendar'),
            'Ultimate Calendar'[Year] = MAX('Ultimate Calendar'[Year]) &&
            'Ultimate Calendar'[Month] <= MAX('Ultimate Calendar'[Month])
        )
    )
RETURN
    IF(
        ISBLANK(SUM('loan collaterals'[Outstanding Amount])),
        LastAmount,
        SUM('loan collaterals'[Outstanding Amount])
    )

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

 

 

Thank you.

 

View solution in original post

8 REPLIES 8
v-karpurapud
Community Support
Community Support

Hi @salame 

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you.

v-karpurapud
Community Support
Community Support

Hi @salame 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

v-karpurapud
Community Support
Community Support

Hi @salame 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

v-karpurapud
Community Support
Community Support

Hi @salame 
Thank you for reaching out to Microsoft Fabric Community Forum.

Try with below DAX:

Amount_Latest = 
VAR LastAmount = 
    CALCULATE(
        SUM('loan collaterals'[Outstanding Amount]),
        FILTER(
            ALL('Ultimate Calendar'),
            'Ultimate Calendar'[Year] = MAX('Ultimate Calendar'[Year]) &&
            'Ultimate Calendar'[Month] <= MAX('Ultimate Calendar'[Month])
        )
    )
RETURN
    IF(
        ISBLANK(SUM('loan collaterals'[Outstanding Amount])),
        LastAmount,
        SUM('loan collaterals'[Outstanding Amount])
    )

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

 

 

Thank you.

 

MFelix
Super User
Super User

Hi @salame ,

 

To what I can understand you want to create a line for each month for each loan is that correct?

A couple of questions on this:

  • Do you want to have this indefinetly for each loan? Is there a end date for each one?
  • Is the amount always the same for all the lines or do your want to do a part of the amount you present on the table?

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



line for each month for each loan is that correct?-this is correct.
yes analysis is done say for a certain year and month...amount should always be nonblack where there has been transaction(amount exist) in that month or not.

Is the amount always the same for all the lines or do your want to do a part of the amount you present on the table?-that was just an example''there are different amounts for each loan per month. For those months that amount is blank for a certain loan...we should always pick previous value for a month that was nonblank

Hi @salame ,

 

Based on the information you have sent can you please send a more complete example so I can get the correct syntax for you.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



I have two tables 
Loan Register(dimension table) linked to loan Collaterals(fact) on Loan No

Loan collateral table has columns collateral Code(unique identifier)|Loan No|Oustanding Amount|Oustanding loan balance date which are posted monthly.

Loan Collateral table is linked to Ultimate Calendar date on Oustanding loan balance date.
I want to analyse Loan No and see Outstanding Amount per month. If outstanding amount is blank in a month like December since there is no transaction for that loan that month..I should see the last nonblank value for a previous month like November.

 

This is what I have:

salamekhamis_0-1742933903291.png

Since transaction only happened in May for Loan-092 I will have that value in May.When we go to June,there is no transaction in June so the value is blank. I need a measure to get the previous value in a month that was nonblank for June..also July it should read the last nonblank month value.
 I got Amount = Calculate(sum('loan collaterals'[Amount])) which can also be found using a direct column in the table loan collaterals

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors