Forum Discussion
jaml
6 years agoRegular Visitor
Comparing stock periods
Hi guys, I would like your help with a private project of mine. I hope you have some ideas. This is probably very easy for some of you. Once a week I copy my entire portfolio and insert it in...
- 6 years ago
Hi, jaml
Based on your description, I created data to reproduce your scenario.
You may create measures as follows.
From period = CALCULATE( MIN('Table'[Timestamp]), FILTER( ALLSELECTED('Table'), 'Table'[Stock Name] = MAX('Table'[Stock Name]) ) ) To period = CALCULATE( MAX('Table'[Timestamp]), FILTER( ALLSELECTED('Table'), 'Table'[Stock Name] = MAX('Table'[Stock Name]) ) ) Amount = var x = [To period] var y = [From period] return CALCULATE( SUM('Table'[Amount of stocks]), 'Table'[Timestamp] = x )- CALCULATE( SUM('Table'[Amount of stocks]), 'Table'[Timestamp] = y )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jaml
6 years agoRegular Visitor
To add to this:
One of my ideas is to create a measure that compares stock amount from period 1 to period 2 - but i have no clue on how to do this when I'm inserting new data on a weekly schedule.