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
Anonymous
Not applicable

Create a measure with filter customer = customer

Hi all,


I am trying to create a measure with values from different tables. They all have a 'customer' column and there are relationships (1:many). Now I want to return the values from certain columns, only when Customer = Customer. If I create a filter Customer = "Customer Name 1" it works, but then I need to create a meassure for every single customer. 

How can I get around this?

Thank you!

1 ACCEPTED SOLUTION

@Anonymous 

Please try

Measure1 =
SUMX (
    Machines,
    Machines[Machines] * RELATED ( 'Average machine price'[Average amount] )
)

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

My apologies, I didn't know how to describe the issue properly without sharing too much information about what my data looks like.

Let me try to give a simplified example:

So I have table 'Machines' and 'Average machine price in thousands' (and in practice several more) and I want to calculate the values in these tables as if there is a row context based on the Customer name. So I want to grab the value in Customer name and only multiply the values where customer names are the same, so multiply the value of Customer 1 in one table with the value of customer table in the other. 
Machines

Customer nameMachines
Customer 15
Customer 23
Customer 34
Customer 41
Customer 55



Average machine price in thousands

Customer NameAverage amount
Customer 1800
Customer 2746
Customer 3479
Customer 4401
Customer 5645

 

I want to multiply 'Machines' with Average Machine Price in Thousands' to get the total spend per customer for instance. (Apologies if it still sounds vague)

@Anonymous 

Thank you it's now clear. Only one thing: any relationship between the the tables? If not, can you create one? What is the cardinality? Is it 1:1?

Thank you @Anonymous 

I guess the machines table is the many?

Anonymous
Not applicable

Correct.

@Anonymous 

Please try

Measure1 =
SUMX (
    Machines,
    Machines[Machines] * RELATED ( 'Average machine price'[Average amount] )
)
Anonymous
Not applicable

There are 1:many relationships between the tables. 

tamerj1
Super User
Super User

Hi @Anonymous 
would you please provide more details?

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.

Top Solution Authors