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

Creating new columns based on 2 other columns

I have a dataset which contains information about the cost of different products. It is based on 6 months worth of data. Each month (July-Dec) was one file, which I combined into one table on Power BI. 

 

There is one 'Cost' column which I need to split into 6 different columns, one column for each month.

 

i.e. July Cost, August Cost, Sept Cost. 

 

I am trying to figure out how I can split the Cost column based on each Source.Name. 

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

Hi, @Anonymous 

Please try to get the data using the default folder connector and select the merge data option in the navigation.
You will get the combined data in the Power Query with an additional column for the source name, and then you can use the UI to change the contents of the column to get what you want.

Result:

vangzhengmsft_0-1646968722300.png

vangzhengmsft_1-1646968773664.png

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

Please try to get the data using the default folder connector and select the merge data option in the navigation.
You will get the combined data in the Power Query with an additional column for the source name, and then you can use the UI to change the contents of the column to get what you want.

Result:

vangzhengmsft_0-1646968722300.png

vangzhengmsft_1-1646968773664.png

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

amitchandak
Super User
Super User

@Anonymous , One way is append, if you have month name in them and then unpivot

 

Another way append with value column name named as different month

 


Append : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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