Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Line diagram with multiple lines

Hi all, 

 

The image you see below shows a slicer (left) and a visual I have created with this slicer. The line diagram visual to the right is how I would like to see my visual, so that's great. The slicer to the left, however, is a concatenation of several variables, because I could not get it to work by selecting the different variables using different slicers. The way I would like to select my variables is shown in the second image. However, if I organise it in this manner, my line diagram aggregates the values and creates only one line. In this case the slicers truly slice the data, whereas I would like them to behave as selectors of the correct lines to reveal in my line diagram visual as shown below. 

 

I have tried using the legenda, however, that does not form a solutution since the legenda option allows for only one variable, whereas I have four to select from. 

 

Does anybody of you know how I can create a line diagram with multiple lines following from multiple variables, which I can select using the slicers from the second image? That would look a bit more sleek than the way I have organised it right now with the concatenated column. 

 

Hope you guys can help, thanks in advance! 

 

 

 

 

  • You may be able to get the desired result by using the concatenated Variabelen as the legend. 
    The problem then becomes all the data is loaded into the visual when there is no selection from any of the slicers.

    You can get around this by amending your measure to test for filtering from any of the slicers and return a blank if no filtering is selected. 

    Example:

     

    Punten Sum =
    var _sum =
    SUM('Table (2)'[Punten])
    var _result =
    SWITCH(
        TRUE(),
        ISFILTERED('Table (2)'[Stad]), _sum,
        ISFILTERED('Table (2)'[Waarde]), _sum,
        ISFILTERED('Table (2)'[Label]), _sum,
        BLANK()
    )
    Return
    _result
     
    Now with a blank visual the user may need some prompting, so you can create a conditional title that tells the user to select a slicer to be able to see data.
     
    I created a very small sample set to illustrate.
     

    The conditional title measure I used was

     

    Title Text =
    var _blank =
    "Please select slicer to view data"
    var _title =
    "ACTUAL CHART TITLE"
    var _testStad =
    IF(ISFILTERED('Table (2)'[Stad]),1,0)
    var _testWaarde =
    IF(ISFILTERED('Table (2)'[Waarde]),1,0)
    var _testLabel =
    IF(ISFILTERED('Table (2)'[Label]),1,0)
    Return
    IF(_testLabel+_testStad+_testWaarde>0,_title,_blank)
     
    This is not a crisp solution, but it should get you going in the right direction.
  • jgeddes's avatar
    jgeddes
    3 years ago

    For the visual I have:

    1st Measure

    2nd Measure

    The title measure is then put in the conditional formatting cell of the visual

     

4 Replies

  • You may be able to get the desired result by using the concatenated Variabelen as the legend. 
    The problem then becomes all the data is loaded into the visual when there is no selection from any of the slicers.

    You can get around this by amending your measure to test for filtering from any of the slicers and return a blank if no filtering is selected. 

    Example:

     

    Punten Sum =
    var _sum =
    SUM('Table (2)'[Punten])
    var _result =
    SWITCH(
        TRUE(),
        ISFILTERED('Table (2)'[Stad]), _sum,
        ISFILTERED('Table (2)'[Waarde]), _sum,
        ISFILTERED('Table (2)'[Label]), _sum,
        BLANK()
    )
    Return
    _result
     
    Now with a blank visual the user may need some prompting, so you can create a conditional title that tells the user to select a slicer to be able to see data.
     
    I created a very small sample set to illustrate.
     

    The conditional title measure I used was

     

    Title Text =
    var _blank =
    "Please select slicer to view data"
    var _title =
    "ACTUAL CHART TITLE"
    var _testStad =
    IF(ISFILTERED('Table (2)'[Stad]),1,0)
    var _testWaarde =
    IF(ISFILTERED('Table (2)'[Waarde]),1,0)
    var _testLabel =
    IF(ISFILTERED('Table (2)'[Label]),1,0)
    Return
    IF(_testLabel+_testStad+_testWaarde>0,_title,_blank)
     
    This is not a crisp solution, but it should get you going in the right direction.
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jgeddes,

       

      Thanks for the reply. I see where you're going. Can you share a screenshot of how you arranged the inputs in your visual as well? And can you also make a screenshot of the two measures you created, since I'm not sure I'm creating them correctly as my solution is not working yet.

       

      Thanks!  

      • jgeddes's avatar
        jgeddes
        Super User

        For the visual I have:

        1st Measure

        2nd Measure

        The title measure is then put in the conditional formatting cell of the visual