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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

find first value

I have the following two tables:

Order and OrdLn

I would like to find OrdLn[Price] where OrdLn[OrdNo] = Order[IDBakssystem] and OrdLn[ProdNo] = "TS-L" and store it in an calculated column TS-L in the Order table.

Unfortunately there are sometimes several instansces where this is true, and this results in an error.

I have looked at similar problems on the forum, but none that matches this or help me solving it.

I have tried with LOOKUP and CALCULATE and FILTERS using FIRSTNONBLANKS and EARLIER without luck.

OrdLn[OrdNo] is also a number and Order[IDBakssystem] is a text, so this needs to be converted with VALUE

1 ACCEPTED SOLUTION
Anonymous
Not applicable

This has been solved by correcting the data in the database, eradicationg the original problem.

 

Thank you very much for your assistance!

View solution in original post

10 REPLIES 10
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered to close this topic?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

This has been solved by correcting the data in the database, eradicationg the original problem.

 

Thank you very much for your assistance!

Anonymous
Not applicable

Hi!

 

Thank you for the follow up.

No it is not solved yet as I have been given other task temporary at work, but I'll let you know as soon as I have tested it.

PattemManohar
Community Champion
Community Champion

@Anonymous  Please post the sample test data (that can be copied easily) and expected output to suggest an accurate solution.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

OrdLn

OrdNoProdNoPrice
73013TS-L8000
73013TS-L0
7301310300000390,456
73013T40
73013T40
73013T40
73013TS-L0
73013 0

 

However with the formula I thought worked, it still returns 0 not 8000.

Hi @Anonymous ,

I am afraid you could not achieve this feature if you have no index for your data column, the FIRSTNONBLANK will just return the minum value for your data:

https://www.sqlbi.com/blog/marco/2015/02/24/use-firstnonblank-and-lastnonblank-instead-of-min-and-max-dax/

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for the reply!

 

I have an Unique column "LnNo", and I suppose I could use the lowes denominator there as it would be the highest probability to be correct, however not guaranteed.

 

 

Hi @Anonymous ,

Ok, if your problem could be solved, don't forget to close this topic.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I'll try it out in the upcomming days, and post the result.

Thank you for your assistance!

Anonymous
Not applicable

OK! 🙂

 

I think I solved it by creating two Columns:

Value_IDBaksystem = IFERROR(VALUE( Ordre[IdBaksystem] );0)
And then
TS-L =
CALCULATE (
FIRSTNONBLANK( OrdLn[Price] ; 1 );
FILTER (
OrdLn;
OrdLn[ProdNo] = "TS-L" && OrdLn[OrdNo] = Ordre[Value_IDBaksystem]
)
)

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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