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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GK94
New Member

Calculate average claims of sales location based on selected customer

Hello!
I've been looking for a while but can't seem to find a solution that fixes my problem. 

I need to calculate the average claims of a sales location to use as a benchmark based on the selected customer. I already have a measure that calculates the percentage of claims to sales, but I'm having trouble implementing the location-based benchmark.

 

I've tried the following:

AVG Claims Location= CALCULATE([Claims%], FILTER(ALL(D_CUSTOMERS), D_CUSTOMERS[LOCATION] = SELECTEDVALUE(D_CUSTOMERS[LOCATION])))
 
Claims% is the measure I use for the claim ratio.
Every customer is linked to a sales location, so when I filter to customer X I want to calculate the average Claims% for the corresponding sales location.
 
Thank you in advance and best regards
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@GK94 , Try one of the two

 

AVG Claims Location= CALCULATE([Claims%], FILTER(ALL(D_CUSTOMERS), D_CUSTOMERS[LOCATION] = MAx(D_CUSTOMERS[LOCATION])))

 

 

AVG Claims Location= CALCULATE([Claims%], allexcept(D_CUSTOMERS, D_CUSTOMERS[LOCATION] ))

View solution in original post

GK94
New Member

Solved it, the formula I tried first worked, I just filtered on the wrong attribute. Stupid mistake on my part. Thank you for your help anyway!

Best regards

View solution in original post

3 REPLIES 3
GK94
New Member

Solved it, the formula I tried first worked, I just filtered on the wrong attribute. Stupid mistake on my part. Thank you for your help anyway!

Best regards

amitchandak
Super User
Super User

@GK94 , Try one of the two

 

AVG Claims Location= CALCULATE([Claims%], FILTER(ALL(D_CUSTOMERS), D_CUSTOMERS[LOCATION] = MAx(D_CUSTOMERS[LOCATION])))

 

 

AVG Claims Location= CALCULATE([Claims%], allexcept(D_CUSTOMERS, D_CUSTOMERS[LOCATION] ))

Thank you @amitchandak ! I've tried both, but unfortunately in both cases it returns the Claim% for the selected customer, not the sales location of the customer. Any idea why that might be?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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