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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.