Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Help with the graphic

Hi! I am having a problem with the graphic of some datas. First, I have the following table: Where: METAS1 = IF([MTTR DIC]>VALUE(META_MTTR[MTTR MAX]);"INEFICIENTE";IF([MTTR DIC]<VALUE([MTT...
  • edhans's avatar
    edhans
    6 years ago

    Ok, Anonymous  I got your file. I did a little digging and now it makes sense to me. Measures return a single value, which depends on the filter context. You cannot use that in a legend. You have two options that I see:

     

    1. Create the field values in Power Query. That will be difficult because of the way the data is stored in other tables and will require joins.
    2. Create a calculated column. Your SWITCH measure will actually work there, but you'll need to test. You can drop that into a legend field of a Pie Chart.

    Then create a measure you want in your values part of the chart. 

    Test Value = COUNTROWS(META_MTTR) for example will count the number of records for each META and show the relevant percentages in the chart.

    As a slight aside, if you will convert your [MTTR promedio (horas)] and [MTTR máx (horas)] to numbers in Power Query (the Tipo cambiado step) click the little ABC in the upper left corner of that column and change it to a number, then you can dispense with all of the VALUE() functions in your model.
     
    Does that help? The issue is you really need to have most/all of your fields you want to slice and dice on coming in as fields from Power Query, and use measure to be the values. There are a lot of places measures cannot work. Slicers, filters, and as we've discovered, many parts of a lot of visuals, because measures return 1 value at calc. You see many in a table, but in reality, it is one value. It just recalculates the measure for that row of the table based on the filter context. It isn't returning a column of 4/5 values you can use as a true column.