Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
wbhite
Helper I
Helper I

Calculated Column with LOOKUPVALUE only returns partial values

Hello all,

I have a fact table with a Calculated Column that looks up an "Account Name" value from a dimention table (I understand that I should have a relationship between the two, but there is another issue that I don't want to tackle yet).  However, for records in the fact table with the exact same lookup value, only a few of them of returning results.  Below is the CC's DAX and a screenshot of the output.  Please let me know if I'm missing something obvious or if you have suggestions.  Thanks!

 

DAX:

 Account Name = 
LOOKUPVALUE(
Accounts[Account Name],
Accounts[Account #],
'FactTable'[Account #])

Output:

Screenshot 2024-09-06 121348.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I’d like to acknowledge the valuable input provided by rajendraongole1. The initial idea was instrumental in guiding my approach.

 

Hi @wbhite ,

 

Based on my testing, consider that it's because there are hidden characters in the Account# of the dim and fact tables.

vlinhuizhmsft_0-1725849397260.png

 

You can use the EXACT function to compare the two texts to see if they are identical, and if so, return the Account Name and then make adjustments.

Account Name1 = 
IF(
    EXACT(
        'Fact'[Account #], 
        LOOKUPVALUE('Dim'[Account #], 'Dim'[Account #], 'Fact'[Account #])
    ),
    LOOKUPVALUE('Dim'[Account Name], 'Dim'[Account #], 'Fact'[Account #]),
    "null"
)

 

A comparison of the two measures is as follows:

vlinhuizhmsft_1-1725849615724.png

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I’d like to acknowledge the valuable input provided by rajendraongole1. The initial idea was instrumental in guiding my approach.

 

Hi @wbhite ,

 

Based on my testing, consider that it's because there are hidden characters in the Account# of the dim and fact tables.

vlinhuizhmsft_0-1725849397260.png

 

You can use the EXACT function to compare the two texts to see if they are identical, and if so, return the Account Name and then make adjustments.

Account Name1 = 
IF(
    EXACT(
        'Fact'[Account #], 
        LOOKUPVALUE('Dim'[Account #], 'Dim'[Account #], 'Fact'[Account #])
    ),
    LOOKUPVALUE('Dim'[Account Name], 'Dim'[Account #], 'Fact'[Account #]),
    "null"
)

 

A comparison of the two measures is as follows:

vlinhuizhmsft_1-1725849615724.png

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

rajendraongole1
Super User
Super User

Hi @wbhite -As you noted, a relationship between your fact and dimension tables would usually be ideal for this lookup scenario,you can verify if there is any data type mismatches, Look for if there is any hidden characters (leading/trailing spaces) and clean the data if it is available any.check for no duplicate values in the dimension table and no missing values in the fact table's key column.

the issue should be resolved, and your LOOKUPVALUE should return correct results for all matching records.

 

Hope the information helps. if you can share sample or dummy infomation in excel will analyse it and share.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.