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
fmarthidalgo
Frequent Visitor

New Column With LOOKUPVALUE DAX

Good morning all! 

 

I'm having trouble trying to create a new column based on the criteria of the two prior columns. 

 

I have column A and Column B. I need to find a way to create column C (Type2) that finds the non-blank field of culumn B and assigns that same value to all cells with the same invoice number in coulmn A, as shown in column C (filled this in manually for the example). Tried a LOOKUPVALUE with FILTERS and I'm still not able to create column C. 

fmarthidalgo_0-1683125910598.png

 

If someone can shed some light into this, it would be very much appreciated! 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @fmarthidalgo ,

 

Whether the connection mode of your data source is Direct Query connection mode, the Earliest() function is not supported on Direct Query connection mode

vyangliumsft_0-1685612308265.png

You might consider using the following DAX:

VAR keyword (DAX) - DAX | Microsoft Learn

Column =
var _number=[INVNUMB]
return
MAXX(
    FILTER(ALL('Table'),
    'Table'[INVNUMB]=_number),[Type])

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @fmarthidalgo ,

 

Whether the connection mode of your data source is Direct Query connection mode, the Earliest() function is not supported on Direct Query connection mode

vyangliumsft_0-1685612308265.png

You might consider using the following DAX:

VAR keyword (DAX) - DAX | Microsoft Learn

Column =
var _number=[INVNUMB]
return
MAXX(
    FILTER(ALL('Table'),
    'Table'[INVNUMB]=_number),[Type])

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@fmarthidalgo , A new column in DAX

 

Type2 = maxx(filter(Table, [INVNUMB] = earlier([INVNUMB]) && not(isblank([Type1])) ), [Type1])

Hi @amitchandak,

 

Thank you for your response, just what I'm looking for in DAX. As suggested above is not working. EARLIER does not let me pull in the [INVNUMB] column and NOT(ISBLANK([Type1])) is asking for a SUM, COUNT, MAX, etc. expression. 

 

Thanks again! 

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.