Forum Discussion

Kalaivani's avatar
Kalaivani
Helper III
1 year ago
Solved

How to create a visualization based on selected measures in slicer

I have a Category Table for Measure which lists all measure names that I am going to use in the dashboard.    I have a matrix visual that shows the the measure category, year-month and correspondin...
  • shafiz_p's avatar
    shafiz_p
    1 year ago

    Yes, if you use line chart , you can use as many measure as you want using field value parameter option. See above example with 4 measure:

    With any 2 selection:

     

    But if you want to use line and column as combo like (Primary and secondary) then you need to adjust the provided measure. How? Use nested if statement or switch function for multiple choice. Let's say i want measure A, B, C to show as a column by selection, then create one measure A with else if statement. Same way other one.

    Hope this solved your problem!!

    If, please accept it as a solution!!

     

    Best Regards,
    Shahariar Hafiz

  • Ritaf1983's avatar
    1 year ago

    Hi Kalaivani 

    In a situation where the metrics have similar proportions and can be compared, you can use a column in the measure table you created as a legend and display the graph with multiple measures based on the selection.
    However, in the case of the metrics shown in the image, this is not feasible because the differences between them are too large to be displayed on the same scale.

    Which means that two axes are needed.
    To use two axes, you need two separate measures, each holding the selection from the slicer.
    To make this dynamic and work even when there are more than two measures, you can use DAX. For example:
    first selection =
    var
    min_selection =
    min(measures_[Measure])
    return
    if (min_selection= "Wrvus",[Wrvus_],
    if(min_selection= "Wrvus/Visit",[Wrvus/visit_],blank()))

    Last selection =
    var
    max_selection =
    MAX(measures_[Measure])
    return
    if (max_selection= "Wrvus",[Wrvus_],
    if(max_selection= "Wrvus/Visit",[Wrvus/visit_],blank()))

     

    This allows working with an unlimited number of measures, but the display will always be limited to two measures at a time, and the formula must explicitly list all possible options.

    Additionally, for the legend to be meaningful, it cannot simply be "First Selection / Second Selection."
    To overcome this, you can create measures that hold only the selected values and use them in text boxes to display the correct labels, while hiding the default legend.
    The legend's font color can be changed to white to make it invisible.
    fs = min('measures_'[Measure])
    Ls = MAX('measures_'[Measure])

    Although we managed to solve the technical challenge of displaying two different measures on a dual-axis chart, from an effective data visualization perspective, this approach is not recommended.

    Combining different metrics in the same graph is misleading because the human brain naturally groups elements into a single unit (Gestalt principles).

    When users first see the graph, their instinctive reaction is to compare the height of the lines—which is inherently incorrect, as these represent two entirely different metrics.

    Even once they realize the mistake, they must still mentally filter out the distraction of the second line to focus on the first. This increases cognitive load, making the comparison harder than it should be.

    A far better alternative is to use small multiples:
    - They eliminate misleading height comparisons by clearly separating the measures.
    - Each metric retains its own scale, ensuring correct interpretation.
    - Because the graphs are aligned, users can still easily compare trends.

    The goal of data visualization is not just to display information but to make interpretation effortless. A well-designed small multiples layout achieves this by reducing unnecessary cognitive effort while preserving clear, accurate insights.

    From here, it's up to you how to proceed. In any case, I'm attaching a PBIX file with all the examples.
    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly