Forum Discussion

SmithaKMurthy's avatar
SmithaKMurthy
New Member
3 years ago
Solved

Display multiple measure values based on slicer selection

Hi All,

I have around 15 measures in my model, which I need to show in a visual (line chart). The chart becomes unreadable if I add all of them directly. Hence, I thought of grouping the measures and providing a slicer to choose one or more of the groups to be displayed in the visual. I have created a table with the below structure-
Index | Measure Type | Measure Name
The table is not linked to any other table in my model. I have created a hierarchy out of this and added it as a slicer shown below-

I have created a measure as below  to display the data in a line chart-

The issue that I'm facing is that the line chart fails to render when I select all (or more than 1) measure type or more than one measure under a specific type. My goal is to allow the user to select a group (such as Geographic Measures) and be shown a graph with multiple lines, each corresponding to the the separate measures like FIRM_CITY_FILL%, FIRM_STATE_FILL% etc.

Could someone please guide me on this?

7 Replies

  • Aburar_123's avatar
    Aburar_123
    Solution Supplier

    Hi SmithaKMurthy ,

    this is because of at last you are using single measure (measureSelection) in the Bar chart so it gives single value and Switch also will return single value. For example you can check what value is returned from the below Switch.

     

    SWITCH(TRUE(),

    MeasureType="FruitRelated" && MeasureName="CostlierFruitPrice",1,

    MeasureType="FruitRelated" && MeasureName="HighestSoldFruitQuantity",2,

    MeasureType="VeggieRelated" && MeasureName="CostlierVeggiePrice",3)

     

    Just Select the MeasureType as FruitRelated in the slicer and check what this measure returns eiter 1 or 2 or both.

     

    One suggestion is, you can try with Calculation group in this case.

     

    Please Accept it as a Solution if it solves your Problem. Thanks.

     

     

     

  • Create Table for measures and name the corresponding measures in the table e.g Measures_Nmae after that create measure with the combination of switch() and SelectedValue() using and return the measure with Measures_Name in the Query 

    • SmithaKMurthy's avatar
      SmithaKMurthy
      New Member

      Hi,
      Thanks for the reply. I don't quite follow what you are saying. I already have a table of measures and even a measure for the selection with the SWITCH(). But it doesn't seem to work. Since I can't share the actual data, I have tried to mock my problem with some silly data-
      I have two tables as below-

      I have a slicer as below-

      The measure for the slicer selection is written as below-

      When I try to see the value of this MeasureSelection, I always end up with the default value. I don't get the outputs of other cases. What am I missing?

      • mh2587's avatar
        mh2587
        Super User

        Try with subcategory I mean avoid && condition it often create ambiguity

  • Aburar_123's avatar
    Aburar_123
    Solution Supplier

    or you can try like this,

     

    HighQuality = switch(true(),max('Measure Category'[Measure Category])="Fruit",[HighQualityFruit],
    max('Measure Category'[Measure Category])="Veg",[HighQualityVeg])
     
    MostSold = switch(true(),max('Measure Category'[Measure Category])="Fruit",[MostSoldFruit],
    max('Measure Category'[Measure Category])="Veg",'Measure Table'[MostSoldVeg])