Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a simple table with columns Fruit and Cost. I would like to add a new measure which takes the value of Cost where Fruit="Pear" and apply it to all rows like so:
Fruit | Cost | New measure |
Apple | 1.0 | 1.2 |
Pear | 1.2 | 1.2 |
Banana | 0.9 | 1.2 |
Orange | 0.8 | 1.2 |
Solved! Go to Solution.
Hi @tommuirwebb
You may try below measure:
Measure = CALCULATE ( [Cost], FILTER ( ALL ( Table1 ), Table1[Fruit] = "Pear" ) )
Regards,
Hi @tommuirwebb
You may try below measure:
Measure = CALCULATE ( [Cost], FILTER ( ALL ( Table1 ), Table1[Fruit] = "Pear" ) )
Regards,
This answer worked for me. Thanks so much for your help.
@tommuirwebb - Create this Measure:
Pear Value = CALCULATE(MAX(FruitTable[Cost]), FruitTable[Fruit] = "Pear")
Hi natelpeterson, thanks for your reply. I had tried this already but this only applies the value for the row which contains Pear. I'd like the Cost value for Pear to apply to all rows in the table.
Ok, so I should start by saying I'm new to PowerBI so forgive me if I've missed something fundamental here. In my example, the Cost column is actually a Measure which is a calculated average price for each fruit. I'm guessing this is why I'm seeing different results?
@tommuirwebb - Try this:
Pear Cost = CALCULATE([Cost], FruitTable[Fruit] = "Pear")
Thanks again, but unfortunately I get the same result. It only applies the value for the row which contains Pear.
@tommuirwebb - could you share your pbix or a screenshot of the model diagram + the code of the Cost measure?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |