Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
2 years ago
Solved

Line graph with values doubled by the x-axis

Good morning, how are you?
Let's see if you can give me a hand...

Context:
Medical patient base... they can be divided into two statuses = News / Stopped

In turn, these two states are divided into rankings according to the reasons for which they are not used.

and one more value is calculated which are the "on treatment" which is a subtraction between news - stopped
The client asked me to put together a bar graph where each bar is a state and in turn divide those bars into the classifications (combine grouped bars with stacked bars)... The problem is that by putting the On Treatment measure as a line, I am doubling the value of it because of the x-axis
As you can see in June, there is twice the 68 because one is assigned to the news and the other to the stopped, but in reality only a 68 should appear... Who has any idea?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Syndicate_Admin ,

    Based on my testing, please try the following methods:

    1.Create the sample table.

    2.Drag the column into the line and chart visual.

    3.Create the new measure to calculate on treatment values.

    OnTreatment = CALCULATE(
            SUM('Table'[Value]),
            'Table'[Statuses] = "News"
        ) - 
        CALCULATE(
            SUM('Table'[Value]),
            'Table'[Statuses] = "Stopped"
        )

    4.Drag the measures into the Line y-axis.

    5.The result is shown below.

     

    Best Regards,

    Wisdom Wu

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin ,

    Based on my testing, please try the following methods:

    1.Create the sample table.

    2.Drag the column into the line and chart visual.

    3.Create the new measure to calculate on treatment values.

    OnTreatment = CALCULATE(
            SUM('Table'[Value]),
            'Table'[Statuses] = "News"
        ) - 
        CALCULATE(
            SUM('Table'[Value]),
            'Table'[Statuses] = "Stopped"
        )

    4.Drag the measures into the Line y-axis.

    5.The result is shown below.

     

    Best Regards,

    Wisdom Wu

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