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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
campelliann
Post Patron
Post Patron

Pivoting "not working" in PowerQuery

So basically I am Pivoting a column called "budget type". That then transforms into "Margem" "Revenue" Custo (3 last columns).

The issue is that this only works if Projecto and subproject  Rows are equal. For instance. Project B has always Sub project y, so the 15 from "Margem" and "Revenue" is aligned. 

But for Project A, because subproject is different I get a null in the revenue first 4 rows. 

Is it possible to pivot only based on column Projecto?

 

 

1) Start (Before Pivoting)

Pivoting0.png

 

2) After Pivoting (Project A should be like project B having 15-15 every row)

Pivoting.png

1 ACCEPTED SOLUTION

You can try removing the column before the pivot. Technically you are unpivoting by the way.

 

Rows to Column = Unpivot

Column to Rows = Pivot

View solution in original post

4 REPLIES 4
nvprasad
Solution Sage
Solution Sage

Hi Campelliann,

 

The transofmation looks correct only. There is no data for revenue with the combination of Projecto A & Subprojecto B. Hence it is showing null. 

 

You can replace null with 0 for last 3 columns ( after transformation).

 

Thank You,

Regads,

Venkat Nalla

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Hi there @nvprasad @ajbogle, is there away to do the Pivot only based on column Project (ignoring SubProject).

You can try removing the column before the pivot. Technically you are unpivoting by the way.

 

Rows to Column = Unpivot

Column to Rows = Pivot

ajbogle
Helper I
Helper I

It actually looks correct. Look at Subprojecto, Projecto and Budget Type (before) and then (after). The reason for the null is that before you pivoted, those rows didn't have a value to begin with, therefore it captures the value as null.

 

(i.e.) Before you pivoted, Projecto A with Subprojecto B did not have a Budget Type of Custo; therefore Null 

 

Double check they should have a value of 15, if so, you need to fill it up/down. Click 'Transform' and look for this:

ajbogle_0-1659727190806.png

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors