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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Kolumam
Post Prodigy
Post Prodigy

Change the first value of a column based on another column

I want to convert the first value of the column to another value based on a column.

 

Eg. The first value of Start Date of Contract is 1st April 2019. I want to convert this value to the start of the year i.e 1st Jan 2019 based on the column "Name". So every time if the Name column has another value, the first row of the Start Date should start from the start of the year.

Kolumam_0-1594093390334.png

Expected Output:

Start Date of ContractEnd Date of ContractComprehensive O&M PriceName
1 Jan 201931 March 2020376Kellogg

 

@amitchandak @parry2k @harshnathani @az38 @mahoneypat @ryan_mayu @nandic @jdbuchanan71 @Anonymous @v-juanli-msft 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Kolumam ,

 

You may create measure like DAX below.

 

 

Start Date of Contact_New = VAR _MinDate= CALCULATE(MIN('Table'[Start Date of Contact]), ALLEXCEPT('Table', 'Table'[Name]))

RETURN

IF(COUNTROWS(FILTER('Table','Table'[Name]=MAX('Table'[Name])))>0 , IF( MAX('Table'[Start Date of Contact])=_MinDate, DATE(YEAR(_MinDate), 1,1), MAX('Table'[Start Date of Contact])),BLANK())

 

126.png

Best Regards,

Amy 

 

Community Support Team _ Amy

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

6 REPLIES 6
v-xicai
Community Support
Community Support

Hi @Kolumam ,

 

You may create measure like DAX below.

 

 

Start Date of Contact_New = VAR _MinDate= CALCULATE(MIN('Table'[Start Date of Contact]), ALLEXCEPT('Table', 'Table'[Name]))

RETURN

IF(COUNTROWS(FILTER('Table','Table'[Name]=MAX('Table'[Name])))>0 , IF( MAX('Table'[Start Date of Contact])=_MinDate, DATE(YEAR(_MinDate), 1,1), MAX('Table'[Start Date of Contact])),BLANK())

 

126.png

Best Regards,

Amy 

 

Community Support Team _ Amy

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

@Kolumam , what you want to do with 12th May .

All start date to be 1st Jan

 

New Date = date(Year([start date]),1,1)

 

only first april

if([start date] = date(Year([start date]),2,1),date(Year([start date]),1,1),[start date] )

 

Or min Date

if([start date] = min([Start Date]),date(Year([start date]),1,1),[start date] )

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

 

12th May should remain as 12th May. It shouldn't convert everything. 

Also, please use code editor to put your formulas as it looks messy.

@Kolumam , In context of you other post I have added one more formula to compare it with Min date. 

You can also try with Minx if needed

if([start date] = minx(Table,[start date]),date(Year([start date]),1,1),[start date] )

 

all are new columns 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

The formula is fine but it is still not based on the column "Name". If we don't add this other column, it will convert for just one record.

@amitchandak Can you help here please?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors