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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ritanoori
Resolver I
Resolver I

First non blank does not work

Hey everyone

I'm trying to use first non blank in DAX. The value I'm trying to use is available in the other refresnced table but it's not working. 

Almost tried everything. 

Why is it not working for this case!! 

 

 

First I tried this DAX first, trying to get the shipment number from FACT_TMS table 

SHIPMENT_NUMBER2 =
CALCULATE (
FIRSTNONBLANK ( Fact_TMS_reports[SHIPMENT_NUMBER], 1 ),
FILTER ( ALL( Fact_TMS_reports ), Fact_TMS_reports[VOUCHER_ID] = Fact_GL[New PONumber ] )
)
 
then thought it might because there is more than one line for this PO, so I created different table that has unique value but it is still not working. 
 
SHIPMENT_NUMBER3 =
CALCULATE (
FIRSTNONBLANK ( Ref_TMS_Reports[SHIPMENT_NUMBER], true() ),
FILTER ( ALL( Ref_TMS_Reports ), Ref_TMS_Reports[Correct Voucher ID] = Fact_GL[New PONumber ] )
)

 

Both are giving blank. 

Here below you can find the excel sample.

https://drive.google.com/file/d/1oAWUXGwd8KyoG_kzvFDsO9wE2KbGrrAh/view?usp=sharing

Appreciate your help. firstnonblankfirstnonblank 

Thanks

Rita

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ritanoori , if this is a new column this should work

minx(filter(Ref_TMS_Reports, Ref_TMS_Reports[Correct Voucher ID] = Fact_GL[New PONumber ]),Ref_TMS_Reports[SHIPMENT_NUMBER])

 

 

or

 

minx(filter(Ref_TMS_Reports, Ref_TMS_Reports[Correct Voucher ID] = Fact_GL[New PONumber ] && not(isblank(Ref_TMS_Reports[SHIPMENT_NUMBER])) ),Ref_TMS_Reports[SHIPMENT_NUMBER])

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@ritanoori , if this is a new column this should work

minx(filter(Ref_TMS_Reports, Ref_TMS_Reports[Correct Voucher ID] = Fact_GL[New PONumber ]),Ref_TMS_Reports[SHIPMENT_NUMBER])

 

 

or

 

minx(filter(Ref_TMS_Reports, Ref_TMS_Reports[Correct Voucher ID] = Fact_GL[New PONumber ] && not(isblank(Ref_TMS_Reports[SHIPMENT_NUMBER])) ),Ref_TMS_Reports[SHIPMENT_NUMBER])

So glad I found this, thank you!!

 

FIRSTNONBLANK was returing values for certain Lookup cells but not the others...

@amitchandak 

Thank you so much 🙂 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors