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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to create a date column in query editor from year and period columns

Hi,

 

I need to create a Date column in my query editor to setup the incremental refresh. In my model I have year and Period columns existing as shown below using which I need to create a Date column.

neelofarshama_0-1648126963328.png

I have create date using DAX in the report

Date=date(Table[YEAR],REPLACE(Table[PERIOD],1,7,""),1) this will give date=12/1/19 

I want the same to be created in query editor for my incremental refresh.

 

Please help

 

7 REPLIES 7
HB13
Helper I
Helper I

 Hi 

You can try #date([YEAR], Number.FromText(Text.End([PERIOD], 2)), 1)

Anonymous
Not applicable

Hi,

Thank you for the reply. I tried your solution but I am getting below error after filltering. Please suggest

neelofarshama_0-1648155062741.png

 

 

 

Once you create the custom date column are you changing its type to DateTime? Does it allow you to?

Anonymous
Not applicable

Yes I changed it to Date format it allowed but then its throwing this error.

Hi @Anonymous , Give my solution a shot and see if it works for you.

Anonymous
Not applicable

Hi @davehus 

Thank you for the reply. The same error is popping up after your solution also.

I created 2 parameters range start - 12/31/2019

range end -12/31/2022

then I applied custom filtering to the created date column >= range start and <=Range end.

When I hit close & apply I am getting this error

neelofarshama_0-1648155562838.png

 

davehus
Memorable Member
Memorable Member

Hi @Anonymous ,

 

This should work Custom column

 

Text.End([Period],2)&"/"&"1"&"/"&Text.From([Year])

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.