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
Anonymous
Not applicable

LOOKUP return incorrect value for same ID

Hi guys, 

I'm walking in circles with this case, and I hope someone could help me.

 

I have two tables connected by One-To-Many relationship. 

 

Table 2 has the scenario below, where I have a column with the following formula:

EndThisMonth = IF(MONTH('DDA BaseVW_CostItem'[EndDate].[Date])=MONTH(TODAY()),"Yes", "No")

 

So far, so good.

glausantos_1-1625022640827.png

 

In order to build a visual, I need to get the EndThisMonth status into Table1 based on CostItemID.

I tried a LOOKUP but I've got the error 'A table of multiple values was supplied where a single value was expected.'

Then this formula seemed to work:

PackageEndThisMonth =

CALCULATE(FIRSTNONBLANK('DDA BaseVW_CostItem'[EndThisMonth],1), FILTER(ALL('DDA BaseVW_CostItem'),VW_PlacementMonthlyBilling[CostItemId]='DDA BaseVW_CostItem'[CostItemId]))

 

But when I put the data from both tables side by side, I noticed the calculation above returns a different value for the same ID.

glausantos_0-1625022543134.png

 

Does anyone know how I could fix this? I've also tried the formula below, but the same issue.

 

PackageEndThisMonth =
MAXX(
FILTER(
'DDA BaseVW_CostItem',
'DDA BaseVW_CostItem'[CostItemId]=EARLIER(VW_PlacementMonthlyBilling[CostItemId])
),
'DDA BaseVW_CostItem'[EndThisMonth]
)
4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous  and @amitchandak 

I updated the sample date. I'm still having the same issue 😕

If someone could give me a light here

https://drive.google.com/file/d/1ItKvrbbFpq3mqrbbwC0ez-J_vsLFr60A/view?usp=sharing

 

Thank you

Anonymous
Not applicable

@Anonymous 

Now, there is no July date in the table, we cannot see the issue with your sample. Maybe update your sample table to include newest month.

 

 

Paul Zheng _ Community Support Team

amitchandak
Super User
Super User

@Anonymous , This one seems correct

ackageEndThisMonth =
MAXX(
FILTER(
'DDA BaseVW_CostItem',
'DDA BaseVW_CostItem'[CostItemId]=EARLIER(VW_PlacementMonthlyBilling[CostItemId])
),
'DDA BaseVW_CostItem'[EndThisMonth]
)
 
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
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
Anonymous
Not applicable

@amitchandak 

I uploaded a sample here. You'll see the PackageEndThisMonth returns YES for activities that ended last month

https://drive.google.com/file/d/1Uv8l6RVM6Kc36v16OMW9ObLtetki2LY4/view

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors