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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.