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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |