cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rick_ferreira
Helper III
Helper III

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 IV
Super User IV

@Rick_ferreira , Create a new column like

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Jihwan_Kim
Community Champion
Community Champion

Hi, @Rick_ferreira 

 

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 accept it as the solution to help other members find it faster, and give a big thumbs up.


Best regards, JiHwan Kim


Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

2 REPLIES 2
Jihwan_Kim
Community Champion
Community Champion

Hi, @Rick_ferreira 

 

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 accept it as the solution to help other members find it faster, and give a big thumbs up.


Best regards, JiHwan Kim


Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

amitchandak
Super User IV
Super User IV

@Rick_ferreira , Create a new column like

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors