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
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

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

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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