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
Anonymous
Not applicable

Build the column with flag if is the first date

Hi guys,
I have a table below:

Rick_ferreira_0-1618224656731.png

I need to build a an adicitonal column when shows 1 if the first date and 0 outherwise like this:

Rick_ferreira_1-1618224724360.png

 

Thanks

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create a new column like

new column =
if([Date] = minx(filter(Table, [Id] = earlier([ID])),[Date]),1,0)

View solution in original post

Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

 

Please try the below for creating a new column.

 

is first =
VAR currentdate = 'Table'[Date]
VAR currentid = 'Table'[id]
VAR previousdateidcolum =
SUMMARIZE (
CALCULATETABLE ( 'Table', FILTER ( 'Table', 'Table'[Date] < currentdate ) ),
'Table'[id]
)
RETURN
IF ( currentid IN previousdateidcolum, 0, 1 )

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

 

Please try the below for creating a new column.

 

is first =
VAR currentdate = 'Table'[Date]
VAR currentid = 'Table'[id]
VAR previousdateidcolum =
SUMMARIZE (
CALCULATETABLE ( 'Table', FILTER ( 'Table', 'Table'[Date] < currentdate ) ),
'Table'[id]
)
RETURN
IF ( currentid IN previousdateidcolum, 0, 1 )

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@Anonymous , Create a new column like

new column =
if([Date] = minx(filter(Table, [Id] = earlier([ID])),[Date]),1,0)

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.