Forum Discussion
Identical LOOKUPVALUE is not working
How can this be possible? The following two DAX formulas differ ONLY by one column, however, the values in those columns are identical! What can be the reason why I get a blank result using the second formula?
3 Replies
- MFelix
Super User
Hi Zyg_D ,
If this is a calculated column you don't need to use the min value on the syntax since you are on row level context so the value is the one on the row you are at.
Not really sure what is the expected result you are looking for but to give you a better answer there is the need to look at your model or have more details.
- Zyg_D
Continued Contributor
MFelix wrote:Hi Zyg_D ,
If this is a calculated column you don't need to use the min value on the syntax since you are on row level context so the value is the one on the row you are at.
Not really sure what is the expected result you are looking for but to give you a better answer there is the need to look at your model or have more details.
Hi, MFelix . Yes, it is a calculated column. The desired result is equal values (in this case: "EVAF") in both formulas, because the input value in the LOOKUPVALUE is the same: 2679. I do not get why result from both formulas differ, because it is only this column which is different, however the value in it is the same!
Sorry, I am not willing to share my data this time. I just seek for any possible explanation, because this does not make sense!
Your suggestion to remove MIN does not work. I get this error:
A single value for column 'PagrEttKap1Id_m' in table 'vwKruviai' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
If I keep only this part
LOOKUPVALUE( PdlPavS_2[PdlSutrPav] , PdlPavS_2[pdl_id] , vwKruviai[PagrEttKap1Id_m] )
I sometimes get correct values and sometimes I get blanks. depending on the value (in case of 2679 I get blanks).- MFelix
Super User
Hi Zyg_D ,
DAX syntax is context based so just because one calculation is correct in a certain context doesn't mean that a similar formula works correctly in another context. Even more you can have the exactly same formula with all the columns and references to tables to be exactly the same and just by change the context the result is incorrect.
In this case I believe that had to do with that issue altough the formula is the same (just one column difference) the context of the formula can be having an impact on the final result.
Without looking at the data model is difficult to pinpoint the error, if you are not abble to provide a mockup of your data I can only give you some generalization for you to check.
- Check the format of the columns if they are both text or number - making lookups wiht different formats returs blanks because the values are not found
- Be carefull with the allexcept because it's a way to keepfilters in the specified column and so changin the row / table context
- Look at the minimum part of your formula since can be picking up incorrect values or no values at all
- If you are abble to make a relationship between the table from were you want the result you can use RELATED
- Don't know what is the final purpose of the column but maybe you can use a measure since the table/row context changes within the visualizations.
Don't know if any of this helps but again context is everything in DAX.