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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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