Forum Discussion

Jessica_17's avatar
Jessica_17
Icon for Helper V rankHelper V
6 months ago
Solved

Filter required for Multiple measures for combo chart

Hello All,
I need you help.!!

I am working with a combination chart (line and clustered column). The columns use separate measures for each year (e.g., 2024 Orders, 2025 Orders, 2026 Orders and corresponding Amount measures), while the line represents the fill rate for each year.

Currently, the visual displays 9 legends because all yearly measures are included, even when a specific year is selected and no data is shown for the others. The client’s requirement is that when a year is selected, only the legends relevant to that selected year should be displayed.

In addition, the client wants a slicer that allows users to choose which measures (and corresponding legends) they want to see in this specific chart. Based on the slicer selection, the chart and its legends should dynamically update to show only the selected measures.

Since the measures come from different tables, removing or dynamically controlling unused measures is not straightforward. I have tried multiple approaches, but the legends still appear even when the measures return no values. I am looking for a solution to dynamically control both the measures and the legend based on slicer and year selection.

13 Replies

  • Hi,

    From your description, it seems like the data is not weel structures.  You should just have to wite 3 measures - Order, Amount and Fill rate.  Furthermore, since you want the user to select a measure to plot, you will have to use Field Paramteters.  To receive more help, share some data to work with.

    • Jessica_17's avatar
      Jessica_17
      Icon for Helper V rankHelper V

      HI Ashish_Mathur ,

      Thanks for the response. I realize my earlier explanation may not have been clear, so let me reframe the issue.

      I am using field parameters, but they are not working as expected in the Columns area of a visual—the column values are showing blank.

      Additionally, I have measures defined like this:

      2024 Orders = CALCULATE(SUM(abc[orders]), calendar[year] = 2024)

      Even when I simplify it to just:

      CALCULATE(SUM(abc[orders]))

      the data does not segregate by year, either in the visual itself or in the legend.

      I am also facing an issue when using a single field parameter in a combo chart. The challenge is that:

      • For each year, the column values and line values come from different measures

      • Because of this, a single field parameter does not work properly for both the column and line

      • Creating two separate field parameters for the same combo chart feels inefficient and does not make sense to me

      Please let me know if a visual example or screenshot would help explain the issue better.

  • Hi Jessica_17 

    Based on the description, it sounds like each year is stored as a separate column rather than having one column for the year and another for the values. From a modeling perspective, that structure isn’t ideal. Consider unpivoting the columns instead. Unpivot columns 

    • Jessica_17's avatar
      Jessica_17
      Icon for Helper V rankHelper V

      Hello danextian ,

      Thanks for the suggestion. Just to clarify, the data model is not structured with separate columns per year. All years exist in the same Year column.

      The complexity comes from the combo chart setup:

      • Column bars represent Orders and Amount

      • The line represents Fill Rate

      • For each of these, I currently have separate measures per year

      If I don’t create year-specific measures, the values do not segregate by year. Instead, Orders and Amount get aggregated into a single bar, which is not the desired outcome—I need them displayed separately by year within the same visual.

      That’s why simply unpivoting or relying on a single measure isn’t solving the issue in this case.