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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
samdep
Advocate II
Advocate II

Table of Multiple Values Supplied Error

Hi Community - I am getting an error with the below DAX - specifically "A table of multiple values was supplied where a single value was expected" and I've been reading about the meaning of this error, but am unsure how to resolve in my specific case. Is there anything glaring that I am overlooking? Any thoughts would be much appreciated. 

The sample table below shows my data - and 'New Column' is my goal.
 
Previous Amount =
IF(
   OR(Opportunity[StageName] = "Closed Lost", Opportunity[Recurring__c] = FALSE()), BLANK(),
          LOOKUPVALUE(Opportunity[Amount], Opportunity[CloseDate],
                 CALCULATE(MAX(Opportunity[CloseDate]),
                      FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
                     && Opportunity[CloseDate]EARLIER(Opportunity[CloseDate])
                     && Opportunity[StageName] = "Closed Won"
                     && Opportunity[Recurring__c] = TRUE())),
                     Opportunity[AccountId], Opportunity[AccountId], Opportunity[Recurring__c], TRUE())
)
 
Many Thanks!
 
AccountIdAmountStageRecurringCloseDateNew Column
A$10Closed WonTrue2/1/22$5 - Previous Value (1/1/22)
B$5Closed WonFalse2/11/22blank -as not recurring and no prior value
A$5Closed WonTrue1/1/22$5 - Previous Value (12/1/21)
C$50Closed LostTrue2/1/22blank - while recurring, stage is closed lost.
C$100Closed WonTrue1/1/22blank - no prior value
A$5Closed WonTrue12/1/22blank - no prior value
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@samdep , Try like

 


New column =
var _max = CALCULATE(MAX(Opportunity[CloseDate]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = EARLIER(Opportunity[CloseDate])
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))

return
CALCULATE(Sum(Opportunity[Amount]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = _max
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
samdep
Advocate II
Advocate II

Thank you so much! This works perfectly!!

amitchandak
Super User
Super User

@samdep , Try like

 


New column =
var _max = CALCULATE(MAX(Opportunity[CloseDate]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = EARLIER(Opportunity[CloseDate])
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))

return
CALCULATE(Sum(Opportunity[Amount]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = _max
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.