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.
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |