Forum Discussion

cmacdo's avatar
cmacdo
Microsoft Employee
10 years ago
Solved

Allow user to select values to be shown?

I have a line graph right now that is showing the changes in several measures I am computing over time.  However, because I have 20 or so measures I want to be able to show the changes for, I was won...
  • Eric_Zhang's avatar
    Eric_Zhang
    10 years ago

    cmacdo


    cmacdo wrote:

    That actually looks like exactly what I need, but I'm going to need to play with it to get it to work for my needs and in PowerBI.  The user is probably only going to want to be able to view one line at a time anyways, so one slicer should be enough.  If you have any more detailed instructions that would be extremely helpful!  Thanks so much!


    To view one line at a time, you can create a table with one column valuing measures names. And filter the measures names in a slicer. In the line chart, put the a measure similar to below.

    MeasureShown =
    IF (
        HASONEVALUE ( 'MeasureNameTable'[MeasureName] ),
        (
            SWITCH (
                LASTNONBLANK ( 'MeasureNameTable'[MeasureName], "blank" ),
                "Measure1", [Measure1],
                [Measure2]
            )
        ),
        [DefaultMeasure]
    )