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
zpaul_010
Helper I
Helper I

How calculate percentage change between the friday closing price and the monday closing price?

Im creating a data visualization for some local stock market movement every week. e.g. top gainers, top losers, etc.

Want to calculate percentage change between the friday closing price and the monday closing price. 

Capture11.PNG

The plan here is to add the succeeding weeks on to the data for some weekly reporting. 

Not sure if the process I did makes sense though: I copy and paste daily data on to one main table as suppose to load the daily table to powerbi and perform the calculations from there. Any advise on this area? 

 

 

 

1 REPLY 1
v-caliao-msft
Employee
Employee

@zpaul_010,

 

We can use LOOKUPVALUE function to get the closing price for the same Stock based on week number and week day. The sample DAX expression would looks like.

WeekNumber = WEEKNUM(Table1[Date])

Weekday = WEEKDAY(Table1[Date])

ThisMondayClosingPrice = IF(Table1[Weekday]=6,LOOKUPVALUE(Table1[Close],Table1[StockCode],Table1[StockCode],Table1[WeekNumber],Table1[WeekNumber],Table1[Weekday],2),BLANK())

 

Regards,

Charlie Liao

 

 

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.