Forum Discussion

dmmanchon's avatar
dmmanchon
Icon for Helper I rankHelper I
6 years ago
Solved

Dynamic field to display in a visualization

Good, the query is as follows:
How I can use the same/single chart to display different columns/metrics in a table dynamically/selectively.
For example if I have a table like this:
NumberSpeedDistanceTime
Álvaro5158
Jorge4184
Raúl2145
Lor that I'm looking for if I have a line chart with the speed value for each name, which I can dynamically change so that I happen to show the distance or time on the chart instead of the speed.
Greetings.
  • dmmanchon unpivot your table and it will be easy, to do so,

     

    - transform data

    - select number column

    - right-click and select unpivot other columns

     

    you will get attribute and value, you can rename these columns if you want. close and apply

     

    - add a slicer with attribute column on it

     

    on your visual, put number and value, and based on slicer value selected the value will change.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

3 Replies

  • dmmanchon unpivot your table and it will be easy, to do so,

     

    - transform data

    - select number column

    - right-click and select unpivot other columns

     

    you will get attribute and value, you can rename these columns if you want. close and apply

     

    - add a slicer with attribute column on it

     

    on your visual, put number and value, and based on slicer value selected the value will change.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi  dmmanchon 

    For your case, you could try one of three ways to get it.

    1. Selected [Speed], [Distance], [Time] then unpivot them in power query, then use new "attribute" field as a slicer.

    This way is simple but it will change table structure

     

    2. use three bookmark as miguel said.

     

    3. Create a Dynamic measure as this blog:

    Dynamically change the information within a visual via a slicer

     

    Regards,

    Lin