Forum Discussion

mehlenbae2's avatar
mehlenbae2
Helper II
3 years ago

Need help creating a measure

I have a matrix that looks like this:

                  Type A   Type B Type C   Type D Type E Type F

Region 10.00%     
Region 20.00%     
Region 3100.00     

 

I need help creating a matrix that shows percent average for each region and Type. Problem is, each Type has a different target and i'd like to use different conditional formatting for each Type. I created 6 columns that show 1 if we met customer satisfaction and 0 if we did not meet customer satisfaction. However, each type is looking at the whole table instead of its specific type making the number way too small.. How can I remedy this for each type??

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    mehlenbae2 Try a single measure like:

    Measure =
      VAR __Type = MAX('Table'[Type])
      VAR __Region = MAX('Table'[Region])
      VAR __Target = SWITCH(__Type,
                       "Type A",10,
                       "Type B",20,
                       "Type C",15
                     )
    // do some more stuff here based on targets, etc.
    • mehlenbae2's avatar
      mehlenbae2
      Helper II

      Greg_Deckler Sorry, I don't think I was clear.  The targets are not the issue- I need to make sure that each SPECIFIC Type gives a percent average based on the type SUM.

       

      For example, for Type A (Met Customer Satisfaction = 50 | Did not meet customer satisfaction: 50) 

      I need to find the average of Met customer satisfaction and did not meet customer satisfaction which in this example would be 50%^^ then split it up by Region.

       

      My issue is that the columns I made look at the entire data set and do not filter the specific Type which makes the average incorrect because it's averaging by rows that are not applicable (other types).  I hope this makes sense. Sorry I am unable to attach the file due to the data sensitivity.

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        mehlenbae2 So are the Types actually in your data or are those coming from a disconnected table? Sample data would really help make heads or tails of this. I don't need actual data, just data that replicates the issue or otherwise simulates the data.