cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## add column with value based on filter

I have two tables

 OrderID Date 1 13-okt 2 14-okt

 OrderID OrderLine Product Price 1 1 A 5 1 2 B 4 2 1 A 5 2 2 B 4 2 3 C 2

I want to add a column in Table 1 with the name of the product with the highest price. So the table looks like this:

 OrderID Date Product 1 13-okt A 2 14-okt A

Which formula should I use?

1 ACCEPTED SOLUTION
Solution Sage

@Anonymous ,

Use something like this with relatioship.

Column = CALCULATE(DISTINCT('Table (4)'[Product ]),FILTER('Table (4)','Table (4)'[Price]=MAX('Table (4)'[Price])))

You can use the above DAX on both Calculated column or Measure.

Regards,
Manikumar

If you think tjis is helpful, please Accept as Solution and leave a like.

If this helps, Appreciate your KUDOS!

Proud to be a Super User!

2 REPLIES 2
Solution Sage

@Anonymous ,

Use something like this with relatioship.

Column = CALCULATE(DISTINCT('Table (4)'[Product ]),FILTER('Table (4)','Table (4)'[Price]=MAX('Table (4)'[Price])))

You can use the above DAX on both Calculated column or Measure.

Regards,
Manikumar

If you think tjis is helpful, please Accept as Solution and leave a like.

If this helps, Appreciate your KUDOS!

Proud to be a Super User!

Super User

@Anonymous , You can not create a column that uses slicer value. Think how can you use measure in place of that

Tutorial Series Dax Vs SQL Direct Query PBI Tips

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors