Data Comparison in Widget

Data Comparison in Widget

Hi Team,

I would like to display data with the comparison of the previous date range according to a user-selected.
Examples: Week - 36 (user selected) vs Week - 35 (auto detected)
                   6th September - 12th September (user selected) vs 30th August - 5th September (auto detected)
Now when I choose "Previous" for the secondary value, it is displaying only last week's data because I group the data by week. The setting I made in the widget is as per attached. 
Please advise me on how I can compare the data flexibly based on a user selection.
Much appreciated for your guidance.