Forum Discussion

orensteinb's avatar
orensteinb
Regular Visitor
1 year ago
Solved

Stacked Line Chart - not stacking up

Hello, I am relatively experienced with power BI but have recently been tasked with creating a visual representation of a company's revenue over time, by entity. As you can see from the examples belo...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, orensteinb .

    Regarding the issue you raised, my solution is as follows:

    First I have created the following table and the column names and data are the data you have given:


    For example, I need the value of column to stay above column2 and the two lines do not intersect:
    1.I've created a measure substitution visualization like this:

    Measure = IF(SUM('Table'[Column])>=SUM('Table'[Column 2]),SUM('Table'[Column]),0)
    Measure 2 = IF(SUM('Table'[Column 2])<SUM('Table'[Column]),SUM('Table'[Column 2]),0)

    2.Then modify the filter:

    3.Here's the original visualization:

    Here's a visualization that uses a measure judgment:

    If your needs involve multiple judgments, you can also choose the switch() function, and here is the documentation:
    SWITCH function (DAX) - DAX | Microsoft Learn
     

    Of course, you can also use PowerQuery to modify the data itself.


    Best Regards,

    Leroy Lu

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