Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I want to create a calculated column in one table (call it TableA) that Calculates a value from another table (TableB) based on column value in TableA
ProdMax = CALCULATE(MAX(TABLEB[Value]) WHERE TABLEA[PRODUCT] = TABLEB[PRODUCT]
Solved! Go to Solution.
Try this:
ProdMax =
VAR _Prod = TABLEA[PRODUCT]
RETURN
CALCULATE ( MAX ( TABLEB[Value] ), TABLEB[PRODUCT] = _Prod )
Other variations:
ProdMax =
CALCULATE (
MAX ( TABLEB[Value] ),
TABLEB[PRODUCT] = EARLIER ( TABLEA[PRODUCT] )
)
ProdMax =
MAXX (
FILTER ( TABLEB, TABLEB[PRODUCT] = TABLEA[PRODUCT] ),
TABLEB[Value]
)
I replicated your data. Solution is as follows. Create a relationship between table A and B based on the product field. Then create a measure :
Try this:
ProdMax =
VAR _Prod = TABLEA[PRODUCT]
RETURN
CALCULATE ( MAX ( TABLEB[Value] ), TABLEB[PRODUCT] = _Prod )
Other variations:
ProdMax =
CALCULATE (
MAX ( TABLEB[Value] ),
TABLEB[PRODUCT] = EARLIER ( TABLEA[PRODUCT] )
)
ProdMax =
MAXX (
FILTER ( TABLEB, TABLEB[PRODUCT] = TABLEA[PRODUCT] ),
TABLEB[Value]
)
Why does STDEV.P not workin place of MAX
I tried your 2nd suggestion and it worked. Thank YOU!!
You need to create a relationship between the two tables. In my response you can see how it is achieved. @AlexisOlson measures work great but you need to get the relationship down for it all to be tied in together.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |