Forum Discussion
coast2coast
2 years agoNew Member
DATESINPERIOD based on dynamic date range AND second dynamic criteria
Hello - this is my first post here and I am new to PowerBI, so please bear with me 🙂 Thank you! I am trying to dynamically sum a value based on a changing date range (3 weeks +/- current row dat...
- Anonymous2 years ago
Hi coast2coast ,
Below is my table:
The following DAX might work for you:
Measure = var result = CALCULATE( SUMX('Table' , 'Table'[Days]), DATESINPERIOD('Table'[Week], MIN('Table'[Week]) , 21, DAY ) ) return resultThe final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
coast2coast
2 years agoNew Member
Anonymous thank you for the response. In your solution, where is the ID criteria determined? I need to be able to slice on both ID and Week where the table could have up to 90K distinct IDs with values for every week.
Also - I keep getting "not enough memory" errors when i try to do even a simple measure like this one, any tips for that? I can't limit my data any more than it is already.