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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
krichmond
Helper IV
Helper IV

Formula field needed that looks at existing fields and returns hard coded dates into new fields

I need help with a formula field that looks at two existing fields and returns hard coded dates into two new fields. The first existing field is called 'dimstartdate'[monthname] and the second existing field is called 'dimstartdate'[yearnumber]. The first new field name will be called 'Media Due' and the second new field name will be called 'Client / Carrier Final Proof Approval'.

 

I know the logic list seems long, but it simply just varies based on the month of the year (for 2023).

 

Logic For Formula Field:

 

- If the 'dimstartdate'[monthname] field is '1' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '11/9/2023' and the 'Client / Carrier Final Proof Approval' field with '12/8/2023'.

- If the 'dimstartdate'[monthname] field is '2' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '12/9/2023' and the 'Client / Carrier Final Proof Approval' field with '1/6/2023'.

- If the 'dimstartdate'[monthname] field is '3' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '1/7/2023' and the 'Client / Carrier Final Proof Approval' field with '2/3/2023'.

- If the 'dimstartdate'[monthname] field is '4' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '2/14/2023' and the 'Client / Carrier Final Proof Approval' field with '3/11/2023'.

- If the 'dimstartdate'[monthname] field is '5' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '3/15/2023' and the 'Client / Carrier Final Proof Approval' field with '4/8/2023'.

- If the 'dimstartdate'[monthname] field is '6' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '4/18/2023' and the 'Client / Carrier Final Proof Approval' field with '5/12/2023'.

- If the 'dimstartdate'[monthname] field is '7' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '5/13/2023' and the 'Client / Carrier Final Proof Approval' field with '6/9/2023'.

- If the 'dimstartdate'[monthname] field is '8' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '6/13/2023' and the 'Client / Carrier Final Proof Approval' field with '7/8/2023'.

- If the 'dimstartdate'[monthname] field is '9' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '7/18/2023' and the 'Client / Carrier Final Proof Approval' field with '8/11/2023'.

- If the 'dimstartdate'[monthname] field is '10' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '8/12/2023' and the 'Client / Carrier Final Proof Approval' field with '9/8/2023'.

- If the 'dimstartdate'[monthname] field is '11' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '9/2/2023' and the 'Client / Carrier Final Proof Approval' field with '9/29/2023'.

- If the 'dimstartdate'[monthname] field is '12' and the 'dimstartdate'[yearnumber] field is '2023' then populate the 'Media Due' field with '10/5/2023' and the 'Client / Carrier Final Proof Approval' field with '11/1/2023'.

1 ACCEPTED SOLUTION
krichmond
Helper IV
Helper IV

Media Due = switch(true(),
dimstartdate[monthnumber] = 1 && dimstartdate[Yearnumber] = 2023, "11/9/2022",
dimstartdate[monthnumber] = 2 && dimstartdate[Yearnumber] = 2023, "12/9/2022",
dimstartdate[monthnumber] = 3 && dimstartdate[Yearnumber] = 2023, "1/7/2023",
dimstartdate[monthnumber] = 4 && dimstartdate[Yearnumber] = 2023, "2/14/2023",
dimstartdate[monthnumber] = 5 && dimstartdate[Yearnumber] = 2023, "3/15/2023",
dimstartdate[monthnumber] = 6 && dimstartdate[Yearnumber] = 2023, "4/18/2023",
dimstartdate[monthnumber] = 7 && dimstartdate[Yearnumber] = 2023, "5/13/2023",
dimstartdate[monthnumber] = 8 && dimstartdate[Yearnumber] = 2023, "6/13/2023",
dimstartdate[monthnumber] = 9 && dimstartdate[Yearnumber] = 2023, "7/18/2023",
dimstartdate[monthnumber] = 10 && dimstartdate[Yearnumber] = 2023, "8/12/2023",
dimstartdate[monthnumber] = 11 && dimstartdate[Yearnumber] = 2023, "9/2/2023",
dimstartdate[monthnumber] = 12 && dimstartdate[Yearnumber] = 2023, "10/5/2023",
BLANK())
 
Client / Carrier Final Proof Approval = switch(true(),
dimstartdate[monthnumber] = 1 && dimstartdate[Yearnumber] = 2023, "12/8/2022",
dimstartdate[monthnumber] = 2 && dimstartdate[Yearnumber] = 2023, "1/6/2023",
dimstartdate[monthnumber] = 3 && dimstartdate[Yearnumber] = 2023, "2/3/2023",
dimstartdate[monthnumber] = 4 && dimstartdate[Yearnumber] = 2023, "3/12/2023",
dimstartdate[monthnumber] = 5 && dimstartdate[Yearnumber] = 2023, "4/8/2023",
dimstartdate[monthnumber] = 6 && dimstartdate[Yearnumber] = 2023, "5/12/2023",
dimstartdate[monthnumber] = 7 && dimstartdate[Yearnumber] = 2023, "6/9/2023",
dimstartdate[monthnumber] = 8 && dimstartdate[Yearnumber] = 2023, "7/8/2023",
dimstartdate[monthnumber] = 9 && dimstartdate[Yearnumber] = 2023, "8/11/2023",
dimstartdate[monthnumber] = 10 && dimstartdate[Yearnumber] = 2023, "9/8/2023",
dimstartdate[monthnumber] = 11 && dimstartdate[Yearnumber] = 2023, "9/29/2023",
dimstartdate[monthnumber] = 12 && dimstartdate[Yearnumber] = 2023, "11/1/2023",
BLANK())

View solution in original post

1 REPLY 1
krichmond
Helper IV
Helper IV

Media Due = switch(true(),
dimstartdate[monthnumber] = 1 && dimstartdate[Yearnumber] = 2023, "11/9/2022",
dimstartdate[monthnumber] = 2 && dimstartdate[Yearnumber] = 2023, "12/9/2022",
dimstartdate[monthnumber] = 3 && dimstartdate[Yearnumber] = 2023, "1/7/2023",
dimstartdate[monthnumber] = 4 && dimstartdate[Yearnumber] = 2023, "2/14/2023",
dimstartdate[monthnumber] = 5 && dimstartdate[Yearnumber] = 2023, "3/15/2023",
dimstartdate[monthnumber] = 6 && dimstartdate[Yearnumber] = 2023, "4/18/2023",
dimstartdate[monthnumber] = 7 && dimstartdate[Yearnumber] = 2023, "5/13/2023",
dimstartdate[monthnumber] = 8 && dimstartdate[Yearnumber] = 2023, "6/13/2023",
dimstartdate[monthnumber] = 9 && dimstartdate[Yearnumber] = 2023, "7/18/2023",
dimstartdate[monthnumber] = 10 && dimstartdate[Yearnumber] = 2023, "8/12/2023",
dimstartdate[monthnumber] = 11 && dimstartdate[Yearnumber] = 2023, "9/2/2023",
dimstartdate[monthnumber] = 12 && dimstartdate[Yearnumber] = 2023, "10/5/2023",
BLANK())
 
Client / Carrier Final Proof Approval = switch(true(),
dimstartdate[monthnumber] = 1 && dimstartdate[Yearnumber] = 2023, "12/8/2022",
dimstartdate[monthnumber] = 2 && dimstartdate[Yearnumber] = 2023, "1/6/2023",
dimstartdate[monthnumber] = 3 && dimstartdate[Yearnumber] = 2023, "2/3/2023",
dimstartdate[monthnumber] = 4 && dimstartdate[Yearnumber] = 2023, "3/12/2023",
dimstartdate[monthnumber] = 5 && dimstartdate[Yearnumber] = 2023, "4/8/2023",
dimstartdate[monthnumber] = 6 && dimstartdate[Yearnumber] = 2023, "5/12/2023",
dimstartdate[monthnumber] = 7 && dimstartdate[Yearnumber] = 2023, "6/9/2023",
dimstartdate[monthnumber] = 8 && dimstartdate[Yearnumber] = 2023, "7/8/2023",
dimstartdate[monthnumber] = 9 && dimstartdate[Yearnumber] = 2023, "8/11/2023",
dimstartdate[monthnumber] = 10 && dimstartdate[Yearnumber] = 2023, "9/8/2023",
dimstartdate[monthnumber] = 11 && dimstartdate[Yearnumber] = 2023, "9/29/2023",
dimstartdate[monthnumber] = 12 && dimstartdate[Yearnumber] = 2023, "11/1/2023",
BLANK())

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Top Kudoed Authors