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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 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.

October NL Carousel

Fabric Community Update - October 2024

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