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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
KarenQ
Frequent Visitor

How to convert text 06/ to date in power bi Table View (text to date conversion)

Hi, I am working on a sales data table in Table View, having 09 Data Period and 2023 as Data Period on two columns to represent current month Mar 2024 as an example.

I created  the below:

MonthNo = if('Sales'[Data Period]<7, 'Sales'[Data Period]+6, 'Sales'[Data Period]-6)
Year = if('Sales'[Data Period]>6,'Sales'[Data Year]+1,'Sales'[Data Year])
Full = 'Sales'[MonthNo]&"-"&'Sales'[Year],
then comes the issue when I created the below. 
FullMonth = datevalue('Sales'[Full])
 
KarenQ_0-1711498925997.png

 

 

Strangely this way of doing dates have been working to me all the time in the past and it even works on my another Bi file. 

not sure why but it gives below. 

 

KarenQ_1-1711499048082.png

 

it is perfecting working as per below in my other Bi files.

KarenQ_2-1711499120932.png

 

 

Anyone could look at this for me please. 

1 ACCEPTED SOLUTION

Use a calculated column to convert the string into proper ISO8601 format

 

yyyy-mm-dd

 

You can use DATE(year, month, day)  to achieve the same (with day replaced by 1)

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

How often does this data change?  Right, never!  There is no need to compute that.  Use an external reference table.

hi thanks for prompt reply. This sales data is udpated daily so I do need to build it into modeling. 

Use a calculated column to convert the string into proper ISO8601 format

 

yyyy-mm-dd

 

You can use DATE(year, month, day)  to achieve the same (with day replaced by 1)

thanks a lot.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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