Forum Discussion

ANKITBISANI's avatar
ANKITBISANI
Icon for Advocate I rankAdvocate I
9 years ago
Solved

Plotting two values for one category in stack bar chart

  Hello Experts ,   In the stack column chart , on Y axix we want brackets for amount range and x axis we want to plot 2 values : Current weights ,Think Weight on the same brackets (Y axis catego...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi ANKITBISANI,

    This issue is caused by that you use improper field (ID) to create relationships between the two tables. You can make a simple test in Query Editor, click your first table and select “Merge Queries” under Home ribbon to merge your second table, you will find that when you expand Think weights column from second table, the Think weights column has same values with Current weights column.


    To achieve your requirement, create a new table using the following DAX.

    amount range =
    FILTER(
    DISTINCT(
    UNION(
    DISTINCT('Current weights'[Current amount range ]),
    DISTINCT('Think Weight'[Think amount range ])
    )
    ),
    NOT(ISBLANK('Current weights'[Current amount range ]))
    )


    Then create relationship using amount range field among three tables as shown in the following screenshot.


    At last, create stacked column chart using fields as shown in the screenshot below.


    Thanks,
    Lydia Zhang