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
Emmeli
Frequent Visitor

Create new rows based on column data

Hi 

 

I would like your help with a problem of mine I'm trying to do a graph in power bi were I can se cost and the budget over time like in the graph below.

Emmeli_0-1684947874075.png

The problem I have is that the data I can download comes in this format.

Cost centerAcc2AccontAktProj
Jan

Feb
Mar
Apr

May

Jun

Jul
 
Aug
Sep 
Oct
 
Nov
Dec
11220 Logistic36 Sale36900 services sold            778778778778778500500778778778778778
11222 Logistic62 IT-cost62100 Rent IT-appl            -85-85-85-85-85-85-85-85-85-85-85-85
11223 Logistic64 Inv64500 Office appliances            -404-404-404-414-414-414-414-414-414-414-414-414

 

But in order for it to work properly in power BI I would like the data to have this format. Or I think I need it to be in this format. How can I create this?

Cost centerAcc2AccontMonthBudget
11220 Logistic36 Sale36900 services sold
Jan
778
11220 Logistic36 Sale36900 services sold
Feb
778
11220 Logistic36 Sale36900 services soldMar778
11220 Logistic36 Sale36900 services sold
Apr
778
11220 Logistic36 Sale36900 services sold
May
778
11220 Logistic36 Sale36900 services sold
Jun
500
11220 Logistic36 Sale36900 services sold
Jul
500
11220 Logistic36 Sale36900 services sold 
Aug
778
11220 Logistic36 Sale36900 services soldSep778
11220 Logistic36 Sale36900 services sold 
Oct
778
11220 Logistic36 Sale36900 services sold 
Nov
778
11220 Logistic36 Sale36900 services soldDec778
11222 Logistic62 IT-cost62100 Rent IT-appl
Jan
85
11223 Logistic63 IT-cost62101 Rent IT-appl
Feb
85
11224 Logistic64 IT-cost62102 Rent IT-applMar85
11225 Logistic65 IT-cost62103 Rent IT-appl
Apr
85
11226 Logistic66 IT-cost62104 Rent IT-appl
May
85
11227 Logistic67 IT-cost62105 Rent IT-appl
Jun
85
11228 Logistic68 IT-cost62106 Rent IT-appl
Jul
85
11229 Logistic69 IT-cost62107 Rent IT-appl 
Aug
85
11230 Logistic70 IT-cost62108 Rent IT-applSep85
11231 Logistic71 IT-cost62109 Rent IT-appl 
Oct
85
11232 Logistic72 IT-cost62110 Rent IT-appl 
Nov
85
11233 Logistic73 IT-cost62111 Rent IT-applDec85
11223 Logistic64 Inv64500 Office appliances
Jan
-404
11224 Logistic65 Inv64501 Office appliances
Feb
-404
11225 Logistic66 Inv64502 Office appliancesMar-404
11226 Logistic67 Inv64503 Office appliances
Apr
-414
11227 Logistic68 Inv64504 Office appliances
May
-414
11228 Logistic69 Inv64505 Office appliances
Jun
-414
11229 Logistic70 Inv64506 Office appliances
Jul
-414
11230 Logistic71 Inv64507 Office appliances 
Aug
-414
11231 Logistic72 Inv64508 Office appliancesSep-414
11232 Logistic73 Inv64509 Office appliances 
Oct
-414
11233 Logistic74 Inv64510 Office appliances 
Nov
-414
11234 Logistic75 Inv64511 Office appliancesDec-414

 

 

 

1 ACCEPTED SOLUTION
barritown
Super User
Super User

Hello @Emmeli,

The easiest way to perform this would be via PowerQuery: 

- you select all the month columns;

- and unpivot them (then you can remove those columns that are not needed and rename the newly created).

barritown_0-1685025663759.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

View solution in original post

2 REPLIES 2
Emmeli
Frequent Visitor

R U Kidding me! It was that easy. Thank you, thank you, thank you😀

barritown
Super User
Super User

Hello @Emmeli,

The easiest way to perform this would be via PowerQuery: 

- you select all the month columns;

- and unpivot them (then you can remove those columns that are not needed and rename the newly created).

barritown_0-1685025663759.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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