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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
red_arrowhead
Helper I
Helper I

How to calculate measure which can return previous value from another measure ?

I have a measure that calculates the closing cash balance for Calendar Weeks. I have used matrix visual which has input from the measure and columns selected from a table having calendar weeks. What I want to do is a closing the cash balance of the previous week is opening the cash balance for next week. How can I create a measure for it. 

 

EG: 

red_arrowhead_0-1614154951928.png

As shown here Closing Cash Balances for CW 8 to CW 18 are presented. Where Closing Cash Balance is a measure and columns (CW08_2021 to CW18_2021) come from a column in a table. 

I want to calculate the opening cash balance measure which is the closing cash balance of the previous CW. 

EG- Closing cash balance of CW 08 will be opening cash balance for CW 09. 

 

How can this measure be calculated?

2 REPLIES 2
Anonymous
Not applicable

Hi @red_arrowhead ,

What's the calculation logic of closing cash balance? It will involve opening cash balance into calculation or not? Here are some links about calculating opening and closing balance, you can refer them. If they are not applicable for your scenario, please provide some sample data and expected result with sample or screenshots(exclude sensitive data). Thank you.

Using DAX in Power BI to solve Closing Balance for the Month with semi-additive measures

Best Regards

amitchandak
Super User
Super User

@red_arrowhead , you can not create previous column in power bi.

 

You have to create a rank on YYYYWW (Fin year and week) and sue that for last week.

 

new column

Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
measures example
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

refer my blog for info

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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