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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cristianml
Post Prodigy
Post Prodigy

Add custom column for date with if

Hi,

 

I want to add a custom column instead of doing it in dax :

How can I write this in Query editor ?

 

Date = DATE(IF([Month #]>=9,[FY]-1,[FY]),[Month #],1)
 
Thanks !
 
 
 
1 ACCEPTED SOLUTION
MahyarTF
Memorable Member
Memorable Member

Hi,

1- You could add another column based on your condition :

if [Month] >= 9 then [FY]-1 else [FY]

MahyarTF_0-1670390701880.png

2-Insert New column :

Text.Combine({Text.From([Date], "en-AU"), Text.From([Month], "en-AU"), Text.From("01")}, "-")

MahyarTF_1-1670390770704.png

3- Change the Column format to Date :

MahyarTF_2-1670390824097.png

Appreciate your Kudos and please mark it as a solution if it helps you

Mahyartf

View solution in original post

1 REPLY 1
MahyarTF
Memorable Member
Memorable Member

Hi,

1- You could add another column based on your condition :

if [Month] >= 9 then [FY]-1 else [FY]

MahyarTF_0-1670390701880.png

2-Insert New column :

Text.Combine({Text.From([Date], "en-AU"), Text.From([Month], "en-AU"), Text.From("01")}, "-")

MahyarTF_1-1670390770704.png

3- Change the Column format to Date :

MahyarTF_2-1670390824097.png

Appreciate your Kudos and please mark it as a solution if it helps you

Mahyartf

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.