Index: ow/static/js/ow.js
===================================================================
--- ow/static/js/ow.js	(revision 9f3c3536858ac65ad061e0cdf5007514559d4003)
+++ ow/static/js/ow.js	(revision 4678c5ea9ee5eb0f2c0a137ce2a99ccbe50bdb75)
@@ -403,5 +403,5 @@
                 })
                 .on('click', function(d) {
-                    window.location.href = d.url;
+                    window.location.href = d.url+'&filter_by='+filter_by;
                 });
 
Index: ow/templates/profile.pt
===================================================================
--- ow/templates/profile.pt	(revision 9f3c3536858ac65ad061e0cdf5007514559d4003)
+++ ow/templates/profile.pt	(revision 4678c5ea9ee5eb0f2c0a137ce2a99ccbe50bdb75)
@@ -111,7 +111,19 @@
             <div class="center">
               <ul class="workout-options filters js-filters">
-                <li><a href="#" class="js-distance is-active" i18n:translate="">distance</a></li>
-                <li><a href="#" class="js-time" i18n:translate="">time</a></li>
-                <li><a href="#" class="js-elevation" i18n:translate="">elevation</a></li>
+                <li>
+                  <a href="#" class="js-distance is-active"
+                     tal:attributes="class 'js-distance is-active' if filter_by == 'distance' else 'js-distance'"
+                     i18n:translate="">distance</a>
+                </li>
+                <li>
+                  <a href="#" class="js-time"
+                     tal:attributes="class 'js-time is-active' if filter_by == 'time' else 'js-time'"
+                     i18n:translate="">time</a>
+                </li>
+                <li>
+                  <a href="#" class="js-elevation"
+                     tal:attributes="class 'js-elevation is-active' if filter_by == 'elevation' else 'js-elevation'"
+                     i18n:translate="">elevation</a>
+                </li>
               </ul>
 
@@ -520,8 +532,8 @@
          current_week: "${current_week}",
          y_axis_labels: y_axis_labels,
-         filter_by: "distance",
+         filter_by: "${filter_by}",
          url: "${'monthly' if current_week is None else 'weekly'}",
      });
-     year_chart.render("distance", "${'monthly' if current_week is None else 'weekly'}");
+     year_chart.render("${filter_by}", "${'monthly' if current_week is None else 'weekly'}");
      year_chart.filters_setup();
      year_chart.switcher_setup();
Index: ow/tests/views/test_user.py
===================================================================
--- ow/tests/views/test_user.py	(revision 9f3c3536858ac65ad061e0cdf5007514559d4003)
+++ ow/tests/views/test_user.py	(revision 4678c5ea9ee5eb0f2c0a137ce2a99ccbe50bdb75)
@@ -414,5 +414,5 @@
         # profile page for the current day (no workouts avalable)
         response = user_views.profile(john, request)
-        assert len(response.keys()) == 7
+        assert len(response.keys()) == 8
         current_month = datetime.now(timezone.utc).strftime('%Y-%m')
         assert response['user'] == john
@@ -432,9 +432,10 @@
             'current_sport': 'cycling'
         }
+        assert response['filter_by'] == 'distance'
         # profile page for a previous date, that has workouts
         request.GET['year'] = 2015
         request.GET['month'] = 6
         response = user_views.profile(john, request)
-        assert len(response.keys()) == 7
+        assert len(response.keys()) == 8
         assert response['user'] == john
         assert response['user_gender'] == 'Robot'
@@ -448,10 +449,17 @@
             'elevation': Decimal(0)
         }
-        # same, passing a week, first on a week without workouts
+        assert response['filter_by'] == 'distance'
+        # same request, but passing a filter_by value
+        request.GET['filter_by'] = 'time'
+        response = user_views.profile(john, request)
+        assert len(response.keys()) == 8
+        assert response['filter_by'] == 'time'
+        # same, passing a week, first on a week without workouts,
+        # keeping the modified filter_by GET param
         request.GET['year'] = 2015
         request.GET['month'] = 6
         request.GET['week'] = 25
         response = user_views.profile(john, request)
-        assert len(response.keys()) == 7
+        assert len(response.keys()) == 8
         assert response['user'] == john
         assert response['user_gender'] == 'Robot'
@@ -464,10 +472,12 @@
             'elevation': Decimal(0)
         }
-        # now in a week with workouts
+        assert response['filter_by'] == 'time'
+        # now in a week with workouts, changing the filter_by again
         request.GET['year'] = 2015
         request.GET['month'] = 6
         request.GET['week'] = 26
+        request.GET['filter_by'] = 'elevation'
         response = user_views.profile(john, request)
-        assert len(response.keys()) == 7
+        assert len(response.keys()) == 8
         assert response['user'] == john
         assert response['user_gender'] == 'Robot'
@@ -481,4 +491,5 @@
             'elevation': Decimal(0)
         }
+        assert response['filter_by'] == 'elevation'
 
     def test_profile_with_nickname(self, dummy_request, john):
Index: ow/views/user.py
===================================================================
--- ow/views/user.py	(revision 9f3c3536858ac65ad061e0cdf5007514559d4003)
+++ ow/views/user.py	(revision 4678c5ea9ee5eb0f2c0a137ce2a99ccbe50bdb75)
@@ -284,4 +284,7 @@
     month = int(request.GET.get('month', now.month))
     week = request.GET.get('week', None)
+    # filter_by can be 'distance', 'time' or 'elevation', defaults to
+    # 'distance' if no value is provided
+    filter_by = request.GET.get('filter_by', 'distance')
     workouts = user.workouts(year, month, week)
     totals = {
@@ -321,5 +324,6 @@
         'current_week': week,
         'totals': totals,
-        'profile_stats': profile_stats
+        'profile_stats': profile_stats,
+        'filter_by': filter_by
     }
 
