Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello Everybody!
This is my first post on the community. So, here I go.
I'm currently working on a dataset that I got from Kaggle, which is Netflix's popular movies and series, This dataset comes from the IMDB website data collected by using web scraping.
I can't figure out a way to transform the dates of the series that range from a StartYear and EndYear in the cell into a date, they're in format text right now. Generally, series dates vary from a Start and End Year; in some cases, some series only have (2019-), which means it's still on the air.
Is there a way that I can make them become actual dates instead of only text?
Sorry if my question sounds stupid I'm quite new to powerBI, I'm still figuring out what the heck I'm doing,
Cheers Guys!!!!
@https://www.kaggle.com/datasets/narayan63/netflix-popular-movies-dataset
Solved! Go to Solution.
Hi @MrTWolff__,
The first step to this would be to split your column into Start and End Year from the range format like 2002-2006.
You can choose '-' as the delimiter. This will give you two columns, one with start year and another with end year. Note that you'll get a null value in the second column for shows that have not yet ended like Stranger Things (Awaiting Finale🙂).
Now you have two columns with year but those would be strings. In order to convert them into dates, just select Date in the list of data types.
Result should look like this:
Works for you? Mark this post as a solution if it does!
Hi , @MrTWolff__
Here are the steps you can refer to :
(1)This is my test data :
(2)We can select "Insert Step After" to add a step .
(3)We can enter this M language in the input box : The firest parameter is the next step name.
= Table.SplitColumn(test, "year" , (x)=> Text.Split(x,"-") ,{"start_year","end_year"},null )
(4)Then we can change the type of the [end_year] type to whole number if we need.
(5)Then we can meet your need , the result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@v-yueyunzh-msft @Shaurya Thank you so so so much Guys. You helped me a lot... Following both of you guys, I took the best approach e figured out the best solution to my problem.
Cheers guys!!!!!
Hi , @MrTWolff__
Here are the steps you can refer to :
(1)This is my test data :
(2)We can select "Insert Step After" to add a step .
(3)We can enter this M language in the input box : The firest parameter is the next step name.
= Table.SplitColumn(test, "year" , (x)=> Text.Split(x,"-") ,{"start_year","end_year"},null )
(4)Then we can change the type of the [end_year] type to whole number if we need.
(5)Then we can meet your need , the result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @MrTWolff__,
The first step to this would be to split your column into Start and End Year from the range format like 2002-2006.
You can choose '-' as the delimiter. This will give you two columns, one with start year and another with end year. Note that you'll get a null value in the second column for shows that have not yet ended like Stranger Things (Awaiting Finale🙂).
Now you have two columns with year but those would be strings. In order to convert them into dates, just select Date in the list of data types.
Result should look like this:
Works for you? Mark this post as a solution if it does!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
102 | |
98 | |
38 | |
37 |
User | Count |
---|---|
152 | |
125 | |
75 | |
74 | |
63 |