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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SBR1D
Helper I
Helper I

CALCULATETABLE returns error " a table of multiple values was supplied where single value expected"

Hi All

 

The following code is returning the error in the title but i've only specified one column so i don't know why?

 

 

lapsed employers v2 = VAR LAPSEDTBL = CALCULATETABLE(SUMMARIZE('Learning Plan','Learning Plan'[Employer Name]),
'Learning Plan'[Status Desc]= "In Progress")
RETURN
 CALCULATETABLE(SUMMARIZE( 'Learning Plan','Learning Plan'[Employer Name]),                                                                                                                                                                                
NOT 'Learning Plan'[Employer Name] IN LAPSEDTBL)  

 

1 ACCEPTED SOLUTION

pls try this

Table1 lapsed employers v2 =
VAR LAPSEDTBL =
    
        SUMMARIZE ( 
                    CALCULATETABLE ('Learning Plan','Learning Plan'[Status Desc] = "In Progress")
                       , 'Learning Plan'[Employer Name] )
RETURN
    
        SUMMARIZE ( 
            CALCULATETABLE ('Learning Plan',NOT 'Learning Plan'[Employer Name] IN LAPSEDTBL)
               'Learning Plan'[Employer Name] )
-----------------
or 
Table2 lapsed employers v2 =
VAR LAPSEDTBL =
    
        SUMMARIZE ( 
                    FILTER ('Learning Plan','Learning Plan'[Status Desc] = "In Progress")
                       , 'Learning Plan'[Employer Name] )
RETURN
    
        SUMMARIZE ( 
            FILTER ('Learning Plan',NOT 'Learning Plan'[Employer Name] IN LAPSEDTBL)
               'Learning Plan'[Employer Name] )

View solution in original post

5 REPLIES 5
SBR1D
Helper I
Helper I

Thank you that works great.

Ahmedx
Super User
Super User

or 
Table2 lapsed employers v2 =
VAR LAPSEDTBL1 =
    
        SUMMARIZE ( 
                    FILTER ('Learning Plan','Learning Plan'[Status Desc] = "In Progress")
                       , 'Learning Plan'[Employer Name] )
VAR LAPSEDTBL2 = SUMMARIZE ( FILTER ('Learning Plan','Learning Plan'[Employer Name] )
RETURN
    
        EXCEPT(LAPSEDTBL2,LAPSEDTBL1)
Ahmedx
Super User
Super User

this returns a table, but not a scolar value. that's why the error comes out

what do you want to receive?

Thanks for the quick reply. I want to see a the emploeyer names not in LAPSEDTBL.  I thought a calculatedtable would be fine for that or can you not use calculatedtable with return?

pls try this

Table1 lapsed employers v2 =
VAR LAPSEDTBL =
    
        SUMMARIZE ( 
                    CALCULATETABLE ('Learning Plan','Learning Plan'[Status Desc] = "In Progress")
                       , 'Learning Plan'[Employer Name] )
RETURN
    
        SUMMARIZE ( 
            CALCULATETABLE ('Learning Plan',NOT 'Learning Plan'[Employer Name] IN LAPSEDTBL)
               'Learning Plan'[Employer Name] )
-----------------
or 
Table2 lapsed employers v2 =
VAR LAPSEDTBL =
    
        SUMMARIZE ( 
                    FILTER ('Learning Plan','Learning Plan'[Status Desc] = "In Progress")
                       , 'Learning Plan'[Employer Name] )
RETURN
    
        SUMMARIZE ( 
            FILTER ('Learning Plan',NOT 'Learning Plan'[Employer Name] IN LAPSEDTBL)
               'Learning Plan'[Employer Name] )

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.