Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

LookupValue issue

Hello,

Im quite new in PowerBI and actually would like to kindly ask you for support.

I had an formula which works for few weeks, and now stopped working> 

NazovOrg = if(isblank(UctDenikHelios[CisloOrg]),UctDenikHelios[Spolocnost],lookupvalue(Organizace_Helios[Nazev],Organizace_Helios[SpolocnostID],UctDenikHelios[SpolocnostId],Organizace_Helios[CisloOrg],UctDenikHelios[CisloOrg]))

 

 
Yesterday it started  to generate an error message> A table of multiple values was supplied where a single value was expected.
 
 
I have checked and corrected formats of inputs but it doesnt help. Based on some advice which I found on this community I have created new one formula:
 
NazovOrg2 = if(isblank(UctDenikHelios[CisloOrg]),UctDenikHelios[Spolocnost],calculate(firstnonblank(Organizace_Helios[Nazev],"n.a."),filter(all(Organizace_Helios),value(Organizace_Helios[SpolocnostID])=value(UctDenikHelios[SpolocnostId])&value(Organizace_Helios[CisloOrg])=value(UctDenikHelios[CisloOrg]))))
This generates diferent one error message> DAX comparison operations do not support comparing values of type Number with values of type Text. Consider using the VALUE or FORMAT function to convert... As I told formats are checked, and even converted in formula to value, so Im lost.

 

I will be very thankfull for advice what should be checked/changed. Thank you. 
  • Anonymous , try like

     

    if(isblank(UctDenikHelios[CisloOrg]),UctDenikHelios[Spolocnost],calculate(firstnonblank(Organizace_Helios[Nazev],"n.a."),filter(all(Organizace_Helios),value(Organizace_Helios[SpolocnostID])=max(UctDenikHelios[SpolocnostId])&& (Organizace_Helios[CisloOrg])=max(UctDenikHelios[CisloOrg]))))

2 Replies

  • Anonymous , try like

     

    if(isblank(UctDenikHelios[CisloOrg]),UctDenikHelios[Spolocnost],calculate(firstnonblank(Organizace_Helios[Nazev],"n.a."),filter(all(Organizace_Helios),value(Organizace_Helios[SpolocnostID])=max(UctDenikHelios[SpolocnostId])&& (Organizace_Helios[CisloOrg])=max(UctDenikHelios[CisloOrg]))))

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you, amitchandak, it works. Im going to study more what exactly caused the issue, but you hacked it.👍😊