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
BrandoCrozier
Regular Visitor

How do I show the value of the previous row in the current column? (and last/end balance of a date)

I am reviewing financial data from multiple accounts and I am trying to put my calculated balances from each table in one table that has every date of the year. I have 2 issues:

 

  1. Not every date has a transaction so I want to be able to show the value from the previous date in any date that would be blank. I am using 0 as a placeholder so that the formula doesn't error. (Red text in formula is what I am trying to change)
  2. I also want to show the last/end balance of a given date, but only know how to use Max, Min, or Sum. So far I did MAX('Table'[Index]) as an accurate placeholder because using Max('Table'[Balance]) can be inaccurate if a payment was made at the end of the day. (Blue text in formula is what I am trying to change)

 

Formula I am trying to use to bring the balances into my "Balance_By_Date" Table:

WFMatch = IF(
	ISBLANK(
		LOOKUPVALUE(WFYearToDate[Date],WFYearToDate[Date],Balance_By_Date[Date])
	)
	, IF(
        Balance_By_Date[Date] = MIN(Balance_By_Date[Date]), SUM(Year_Opening_Balances[WF]) , 0)
	, CALCULATE(
        MAX(WFYearToDate[Index])
))
WFMatch = IF(
    ISBLANK(
        LOOKUPVALUE(WFYearToDate[Date],WFYearToDate[Date],Balance_By_Date[Date])
    )
    , IF(
Balance_By_Date[Date] = MIN(Balance_By_Date[Date]), SUM(Year_Opening_Balances[WF]) , 0)
    , CALCULATE(
MAX(WFYearToDate[Index])
))

 

Image 1 - Formula I am trying to use to bring the balances into my "Balance_By_Date" Table

Formula_Example_In_New_Table.jpg

 

 

Image 2 - "WFYearToDate" Table

Table_Balance_Comes_From.jpg

 

Thank you!!!

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @BrandoCrozier 

Open Edit queries, merge queries

Capture1.JPG

then expand values, fill down (before fill down ,sort ascending by "date" column)

Capture2.JPGCapture3.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @BrandoCrozier 

Open Edit queries, merge queries

Capture1.JPG

then expand values, fill down (before fill down ,sort ascending by "date" column)

Capture2.JPGCapture3.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.