Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dynamic Line Chart with Total and many lines

Hi Experts
 
I am trying to create and dynamic line chart based on status, current i have measure that is the sum the Staus A and B and I plot these to give me multiple line and then I sum the two Status to get the total. See pbix..
 
I want to be able to dynamically have a total line, and also be able to select either Status A and or B or both on the same graph.

https://www.dropbox.com/s/1gm1qzku7abd3gu/line_and_bar.pbix?dl=0
 
 
  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous Please create two measure 

    Total = CALCULATE(SUM('Table (2)'[amount]),ALL('Table (2)'[status]))
    
    SelectedStatus = CALCULATE(SUM('Table (2)'[amount]),ALLSELECTED('Table (2)'[status]))

    First is for total and second is for selected status. let me know if have any question 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous Please create two measure 

    Total = CALCULATE(SUM('Table (2)'[amount]),ALL('Table (2)'[status]))
    
    SelectedStatus = CALCULATE(SUM('Table (2)'[amount]),ALLSELECTED('Table (2)'[status]))

    First is for total and second is for selected status. let me know if have any question 

    • Anonymous's avatar
      Anonymous
      Not applicable

      many thanks.. vimal much appericated.

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi vimal...

       

      slight issue if you add a slicer to the pbix file, and you select only status A, the graph works fine, when you select both A and B i would expect to see two line and the total. But i am getting the sum of lines A and B and the total which is incorrect. see image