Forum Discussion
Need help creating a measure
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.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_Deckler3 years agoCommunity 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.
- mehlenbae23 years agoHelper II
Here is an Excel sheet. I am trying to replicate this in PBI by using a matrix:
Here is my table:
My issue is that I need to create a measure to calculate average Customer Satisfaction for each Product Type because of conditional formatting (each product type has different customer satisfaction target). However, when I average a product type it looks at the entire table instead of the rows that specify the Target Type. Keep in mind I need all of the Product Type values in the Matrix seperately. I am aware that it works perfectly when you put Product Type as Columns and average it that way however conditional formatting will not work the way I want it.
I would attach my test PBI but am not sure how.. Here is a picture:
Thank you very much!