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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
BHinote
Frequent Visitor

FIRSTNONBLANK or Alternative to extract a single cell based on two filter criteria

Is there any way to do something similar to the following at the Power Query (i.e. M-Code) level?

 

Task_DteDwnCmp_Date = 
CALCULATE (
    FIRSTNONBLANK ( DW_TaskAddonDataView[Task_CompletedDate], 1 ),
    FILTER ( ALL ( DW_TaskAddonDataView ), 'DW_TaskAddonDataView'[Order_RootID] = 'SPSOrderProfile'[RootID] && LOWER('DW_TaskAddonDataView'[LookupCD]) = "dtedwncmp" ))

 

The Calculated Column above works as intended in DAX.  It retrieves a single cell value for the "First" Non-Blank record that matches the Two Filter Criteria.

I created a Custom Formula at the Power Query Level, which can only include Columns available in Power Query.  Because of this, I must find a way to create a Custom Column, at the same level, that contains the Date from a Second Table when the content in Two different columns match Two Columns from the Second Table.

 

Any positive assistance would be greatly appreciated.

(Here is an example)

Table: SPSOrderProfile

image.png

 

 

 

Table: DW_TaskAddonDataView

image.png

 

 

 

 

 

 

 

 

Result: (The Result is made up of a Unique Record from the SPSOrderProfile Table and the 1st Non-Blank "DteDwnCmp" record found in the DW_TaskAddonDataView table, filtered by SpsOrderProfile[RootId#] = DW_TaskAddonDataView[Order_RootId#] and DW_TaskAddonDataView[LookupCD] = "DteDwnCmp")

image.png

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @BHinote 

Can you please show two simple tables as example and the final result you would need from them? I am not sure I understad exactly  what you are after

Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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