Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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!
Solved! Go to Solution.
@Anonymous
Please try
Measure1 =
SUMX (
Machines,
Machines[Machines] * RELATED ( 'Average machine price'[Average amount] )
)
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 name | Machines |
| Customer 1 | 5 |
| Customer 2 | 3 |
| Customer 3 | 4 |
| Customer 4 | 1 |
| Customer 5 | 5 |
Average machine price in thousands
| Customer Name | Average amount |
| Customer 1 | 800 |
| Customer 2 | 746 |
| Customer 3 | 479 |
| Customer 4 | 401 |
| Customer 5 | 645 |
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?
Correct.
@Anonymous
Please try
Measure1 =
SUMX (
Machines,
Machines[Machines] * RELATED ( 'Average machine price'[Average amount] )
)
There are 1:many relationships between the tables.
Hi @Anonymous
would you please provide more details?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |