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.
Hi there, I have a question on return min value. Below is a sample data set.
Under Company column, the last two rows are blank.
I would like to have a measure to return the company name with a minimum price. However, when Company name = null, the corresponding price value should not be included. In this case, 0 would not be considered.
Also, price can be duplicate. So I'd like to return either the first company value or the last company value unless there is a better way to handle this.
Here is my measure but doesn't work:
Solved! Go to Solution.
@Anonymous , Try like
MINSUB =
VAR min_pice =CALCULATE(MIN(Table[PRICE]),filter(Table, Table[Company] <> "" && not(isblank(Table[Company]))))
VAR min_sub =
calculate(min(TABLE[COMPANY]),FILTER(Table,price = min_pice && Table[Company] <> "" && not(isblank(Table[Company]))))
return min_sub
@Anonymous , Try like
MINSUB =
VAR min_pice =CALCULATE(MIN(Table[PRICE]),filter(Table, Table[Company] <> "" && not(isblank(Table[Company]))))
VAR min_sub =
calculate(min(TABLE[COMPANY]),FILTER(Table,price = min_pice && Table[Company] <> "" && not(isblank(Table[Company]))))
return min_sub
Thank you so much. It worked!
I'm just trying to understand it. Because it is a measure, so that it will return an aggregated value, and that's why we can use min on a text column?
also, what's the meaning of not(isblank(Table[Company]) for both variable? I thought Table[Company] <> "" handles the blank fields but seems it does not?
Again thank you very much for your quick answer. @amitchandak
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 |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |