I have a table that contains a value at the end of each quarter categorized by ID. I want to create a DAX measure that gives me the earliest value, the current value, and the value for the two previous quarters.
I’ve added a screenshot below of how my table could look.
So, using a slicer for YearQuarter from my date table and a slicer for ID, I select ID = 1 and YearQuarter = 2024 Q1 I the output table should look like:
YearQuarter | ID | Value |
---|---|---|
2022 Q1 | 1 | 43 |
2023 Q3 | 1 | 11 |
2023 Q4 | 1 | 59 |
2024 Q1 | 1 | 14 |
Preferably, the number of previous quarters shown should be easily changable (more nice to have, than must have).