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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MikeO
Helper I
Helper I

No duplicates present, but LOOKUPVALUE still says "A table of multiple values was supplied... "

I am using the following formula to determine end date of an advertisement:

 

End Date =
IF (
'Source Marketing Merged'[Run Number] = 1,
TODAY (),
LOOKUPVALUE('Source Marketing Merged'[Adjusted Run Date],'Source Marketing Merged'[Newspaper],'Source Marketing Merged'[Newspaper],'Source Marketing Merged'[Store Name],'Source Marketing Merged'[Store Name],'Source Marketing Merged'[Run Number],'Source Marketing Merged'[Run Number]-1)

 

The last advertisement to run always has a Run Number of 1, thus it gets an End Date equal to today.  Every additional advertisement gets an End Date equal to the Adjusted Run Date of the next advertisement to run in the newspaper for that store.

 

The error result I am getting is "A table of multiple values was supplied where a single value was expected."  This should mean there are duplicates present, but I tested for duplicates by combining Source Marketing Merged'[Newspaper]&,'Source Marketing Merged'[Store Name]&'Source Marketing Merged'[Run Number] all into one column, then using the following formula to check for duplicates:

 

Duplicate Check =
CALCULATE ( COUNT ( 'Source Marketing Merged'[Source, Store and Run Date] ), ALLEXCEPT ( 'Source Marketing Merged', 'Source Marketing Merged'[Source, Store and Run Date] ) )

 

The result shows no duplicates, and yet I still get the same error message above on my LookupValue formula.  Just to make sure my Duplicate Check formula wasn't the problem, I also used this:

 

Duplicate Run Dates = CALCULATE(COUNTA('Source Marketing Merged'[Source, Store and Run Date]),filter('Source Marketing Merged','Source Marketing Merged'[Source, Store and Run Date]=EARLIER('Source Marketing Merged'[Source, Store and Run Date])))

 

Both formulas are showing no duplicates.  Does anyone know why this formula, which worked before today, is having this problem when there are no duplicates?

 

Thank you!

1 ACCEPTED SOLUTION
MikeO
Helper I
Helper I

I didn't get an answer to the error that I was getting, but I did find a solution.  Specifically, I had a separate table that had everything except for store names.  The lookupvalue formula works on that table for calculating End Date, so I simply reference that table and pull end date.  So while I did not get an answer to the specific problem I was having (i.e., the lookupvalue formula thinking I had duplicates when I did not), I did find another way to get to my answer.

View solution in original post

2 REPLIES 2
MikeO
Helper I
Helper I

I didn't get an answer to the error that I was getting, but I did find a solution.  Specifically, I had a separate table that had everything except for store names.  The lookupvalue formula works on that table for calculating End Date, so I simply reference that table and pull end date.  So while I did not get an answer to the specific problem I was having (i.e., the lookupvalue formula thinking I had duplicates when I did not), I did find another way to get to my answer.

AlB
Super User
Super User

Hi @MikeO

 

Can you provide the pbix file?

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.