Forum Discussion

Pikachu-Power's avatar
Pikachu-Power
Impactful Individual
5 years ago
Solved

Line Charts with Filter

Hello,

 

I have the following three measures I want to show as a line chart: 

 


MeasureA = CALCULATE(SUM(Table1[Value1]), Table1[Layer] = "A")

MeasureB = CALCULATE(SUM(Table1[Value1]), Table1[Layer] = "B")

MeasureC = CALCULATE(SUM(Table1[Value1]), Table1[Layer] = "C")

 

with the possibility to filter A, B, C (or all possible combinations AB, BC, AC, ABC). How can I do that? Always have problems when i choose two values. 

8 Replies

  • nvprasad's avatar
    nvprasad
    Solution Sage

    Hi,

     

    Please create one more measure with the if or switch function. then pass the measure in the value section of the visual.

     

    Ex: If (selectedmeasure = A, A, if selectedMeasrue = B, C)

    Appreciate a Kudos! 🙂
    If this helps and resolves the issue, please mark it as a Solution! 🙂

    Regards,
    N V Durga Prasad

     

     

     

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Instead of 3 measures, why not just use the Table1[Layer] column in the legend for the visual and add a slicer for that column too?

    Regards,

    Pat

     

    • Pikachu-Power's avatar
      Pikachu-Power
      Impactful Individual

      I already tried this... you never see two line charts if you selected two. you see one line chart with the sum of these.

    • Pikachu-Power's avatar
      Pikachu-Power
      Impactful Individual

      Ok sorry... layer in legend is possible.

       

      But I use a line- and bar chart and have more measures in the value field. as far as i know we have no legend there or we cant use the legend field in case of more measures in the value field.

       

      i suppose an another way to filter the line carts (and bar charts) will complicated?

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Pikachu-Power ,

     

    Like this?

    If not, please show the screenshot of the 'Line chart'. I want to know which fields you use in the visual and what effect you want to get.

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Pikachu-Power ,

     

    Like this?

    Or like this?(In this case, only two lines can be returned according to the user's choice.)

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.