Forum Discussion

Bnjmnrod's avatar
Bnjmnrod
Regular Visitor
3 years ago
Solved

Line chart visual with two lines based on two slicers

Hello! 

(I am quite new to Power BI)

I need to create a line chart to compare the revenue of customers. I've divided the report page in two areas, each for a customer. So on the left I have a slicers for customer 1 and on the right for customer 2. I want to combine these selections in one line chart with 2 lines. 1 line for each selected customer. 

Is there anyone that maybe has an solution for this?

 

thank you!

11 Replies

  • Hi Bnjmnrod ,

    In each line measure you have to check if that value is selected or not

     

    example

     

    ABC new = If("ABC" in allselected(Slicer[Slicer]) , [ABC], blank())

     

    DEF new = If("DEF " in allselected(Slicer[Slicer]) , [DEF ], blank())

    Thanks ,
    Pratyasha Samal
    Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
    If you found this post helpful, please give Kudos C

  • Hi Bnjmnrod 

    The desired result could be achieved in one graph by:
    Time points on the X axis
    Revenue on the Y
    A customer name on the legend

    As you can see in the attached pic

    Link to sample file 

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

     
    • Bnjmnrod's avatar
      Bnjmnrod
      Regular Visitor

      Hi, 

       

      the customer list is very large so this is showing a lot of lines in the graph.. I also want to have the slicer (that is also affecting other visuals) to insert a line in the chart

      • Ritaf1983's avatar
        Ritaf1983
        Super User

        Hi,
        It's ok you will see only the customers you have selected on the slicer

        and slicer affects all visuals on the page