Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
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?
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
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |