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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.