Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mehlenbae2
Helper II
Helper II

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 4
Greg_Deckler
Community Champion
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.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@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.

@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.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

Here is an Excel sheet. I am trying to replicate this in PBI by using a matrix:

mehlenbae2_0-1664278871415.png

 

Here is my table:

mehlenbae2_3-1664279373493.png

 

 

 

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:

mehlenbae2_4-1664279739675.png

Thank you very much!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.