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

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.

Reply
Brett007
Helper III
Helper III

A table of multiple values was supplied where a single value was expected (With a twist...)

I have a formula that I am copying from the original dataset to the Archive Dataset (stores the original dataset once a week) Same table names just "Archive" added to the front of their names.  

 

My question is how would I resolve this error when it works in the Main Dataset?  

 

This is the calculated Column:

Milestone Latest Disposition =
VAR flag = CALCULATE(MAX('archiveddatasettable1'[Disposition #]),
FILTER('archiveddatasettable1',
EARLIER('archiveddatasettable1'[Milestone History Lookup]) = 'archiveddatasettable1'[Milestone History Lookup]))
RETURN
LOOKUPVALUE('archiveddatasettable1'[Milestone Disposition Status],
'archiveddatasettable1'[Disposition #],
flag,
'archiveddatasettable1'[Milestone History Lookup],
'archiveddatasettable1'[Milestone History Lookup])
 
All of the Values are pulled from the same table.  Other calculations work just fine.  
If I go into the dataset 'Transform Data' and filter it to just one month then the calculation works.  I think that should tell me something, but I don't know where to turn next.
1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Brett007 

 

You may try the following calcualted column to see if it works.

Milestone Latest Disposition =
VAR flag =
    CALCULATE (
        MAX ( 'archiveddatasettable1'[Disposition #] ),
        FILTER (
            'archiveddatasettable1',
            EARLIER ( 'archiveddatasettable1'[Milestone History Lookup] ) = 'archiveddatasettable1'[Milestone History Lookup]
        )
    )
RETURN
    CALCULATE (
        MAX ( 'archiveddatasettable1'[Milestone Disposition Status] ),
        FILTER (
            ALL ( 'archiveddatasettable1' ),
            'archiveddatasettable1'[Disposition #] = flag
                && 'archiveddatasettable1'[Milestone History Lookup]
                    = EARLIER ( 'archiveddatasettable1'[Milestone History Lookup] )
        )
    )

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Brett007 

 

You may try the following calcualted column to see if it works.

Milestone Latest Disposition =
VAR flag =
    CALCULATE (
        MAX ( 'archiveddatasettable1'[Disposition #] ),
        FILTER (
            'archiveddatasettable1',
            EARLIER ( 'archiveddatasettable1'[Milestone History Lookup] ) = 'archiveddatasettable1'[Milestone History Lookup]
        )
    )
RETURN
    CALCULATE (
        MAX ( 'archiveddatasettable1'[Milestone Disposition Status] ),
        FILTER (
            ALL ( 'archiveddatasettable1' ),
            'archiveddatasettable1'[Disposition #] = flag
                && 'archiveddatasettable1'[Milestone History Lookup]
                    = EARLIER ( 'archiveddatasettable1'[Milestone History Lookup] )
        )
    )

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HotChilli
Super User
Super User

I think we have to asume it's the LOOKUPVALUE

-> LOOKUPVALUE looks for a single value satisfying the conditions in the target table. In case the search returns multiple values, you obtain an obscure error message saying: “A table of multiple values was provided where a single value was expected”.

 

The data will be different in the archive data compared to the live set and there are multiple values returned.

What would you suggest I use to replace the LOOKUPVALUE?  Can I add another calculation within or outside of the LOOKUPVALUE to correct this issue?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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