How to create a measure which helps to derive the sprint wise information within a PI

I am trying to pull in information about the sprint wise within a PI. The problem is with the existing sprint measure, it pulls information across all sprints, which I dont need. I just want the data customized within a PI. Is there a better way of doing it? Thanks, Naresh