cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
warnera
Helper I
Helper I

Converting date summary from report

Hello,  I searched around the forum and couldn't find my situation. I have a report that creates summary months in this format: 2019M2 , 2019M3, etc.

 

I tried a few different things I read on here but am still unable to get powerBI to recognize as a date. Does anyone have any suggestions? I have a functioning date table if that helps.

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @warnera ,

 

We can use the following steps in Power Query Editor to meet your requirement.

 

1. Split column by "M".

 

Con 1.jpg

 

2. We select the two columns at same time, then we select merge columns function.

 

Con 2.jpg

 

3. At last we need to merge the columns by "/", and change the type to date. 

 

Con 3.jpg

 

The result like this,

 

Con 4.jpg

 

If it does not meet your requirement, could you please show the exact expected result based on the table that we have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-zhenbw-msft
Community Support
Community Support

Hi @warnera ,

 

We can use the following steps in Power Query Editor to meet your requirement.

 

1. Split column by "M".

 

Con 1.jpg

 

2. We select the two columns at same time, then we select merge columns function.

 

Con 2.jpg

 

3. At last we need to merge the columns by "/", and change the type to date. 

 

Con 3.jpg

 

The result like this,

 

Con 4.jpg

 

If it does not meet your requirement, could you please show the exact expected result based on the table that we have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

amitchandak
Super User
Super User

@warnera , In case you have like from 2019M1 to 2019M12

It can give date like

New Date =date(left([Month],4),month(right([Month],len([Month])-SEARCH("M", [Month],0,0) )),1)

ou might have adjust the month calc

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

@amitchandak I tried your formula and got the following error. Also included a screenshot of my exact file. 

 

Thanks for the help

 

ot this:2020-06-11 10_22_21-SAAR Dashboard - Power BI Desktop (May 2019).png2020-06-11 10_22_00-SAAR Dashboard - Power BI Desktop (May 2019).png

 

 

@warnera , Try like

date((LEFT([summaryYM],4)+0),(right([summaryYM],LEN([summaryYM])-SEARCH("M",[summaryYM]))+0),1)

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.