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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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