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
onernoa
New Member

Custom Column that returns Yes or No if the entry Date is Max for an ID number

Hello

 

In Power Query I want to create a custom column that returns a yes or no for the MAX load_timestamp for each given cardId.

 

cardIdload_timestampDesired Column
100118/08/2022Yes
100218/08/2022

Yes

100318/08/2022Yes
100111/08/2022No
100211/08/2022No
100311/08/2022No

 

Thank you in advance!

1 ACCEPTED SOLUTION
bilalrana
Resolver I
Resolver I

Hi @onernoa,

 

Firstly you need to click on the Data Icon on the left border and open the table in which you want to put the Desired Column.

bilalrana_1-1660822938854.png

 

Now, paste the DAX forumla into formula bar and click on the Tick Icon.

Desired Column = 

var MaxTimestamp = CALCULATE (

MAX ( 'Table'[load_timestamp]),

ALLEXCEPT ( 'Table', 'Table'[cardId] )

)

var result = if( 'Table'[load_timestamp] = MaxTimestamp, "Yes", "No")

return result

bilalrana_0-1660823098285.png

 

If this answers your question, please mark it as a solution!
 

View solution in original post

2 REPLIES 2
bilalrana
Resolver I
Resolver I

Hi @onernoa,

 

Firstly you need to click on the Data Icon on the left border and open the table in which you want to put the Desired Column.

bilalrana_1-1660822938854.png

 

Now, paste the DAX forumla into formula bar and click on the Tick Icon.

Desired Column = 

var MaxTimestamp = CALCULATE (

MAX ( 'Table'[load_timestamp]),

ALLEXCEPT ( 'Table', 'Table'[cardId] )

)

var result = if( 'Table'[load_timestamp] = MaxTimestamp, "Yes", "No")

return result

bilalrana_0-1660823098285.png

 

If this answers your question, please mark it as a solution!
 

Many thanks. This has worked perfectly. 

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.