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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
netanel
Post Prodigy
Post Prodigy

Pivot Column in Query

Hey All!

 

I'm trying to make a column "Data Source" From rows to columns

Pivot 2.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

But I get the following message?

Pivot.JPG

 

Can anyone help?

 

 

 








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @netanel ,

The sample in case seems like not your fact table, right? The error means that PowerQuery is expecting a textual input but receives nothing. You need to make sure it receives a textual input. Try replacing empty fields by "null" or "empty". This can be done either manually within the source (transform the column or create a new column) or within PowerQuery.

About how to replace null values with custom values in PowerQuery:

https://www.edureka.co/community/40467/replace-null-values-custom-values-power-power-query-editor

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @netanel ,

The sample in case seems like not your fact table, right? The error means that PowerQuery is expecting a textual input but receives nothing. You need to make sure it receives a textual input. Try replacing empty fields by "null" or "empty". This can be done either manually within the source (transform the column or create a new column) or within PowerQuery.

About how to replace null values with custom values in PowerQuery:

https://www.edureka.co/community/40467/replace-null-values-custom-values-power-power-query-editor

 

Best Regards,
Community Support Team _ kalyj

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

selimovd
Most Valuable Professional
Most Valuable Professional

Hey @netanel ,

 

you can just select the "Data Source" Column and then chose "Pivot Column".

In the upcoming dialogue, choose "Sum" as aggregation type for the values:

selimovd_0-1637065530046.png

Then the result will be as you desired:

selimovd_1-1637065569746.png

 

 

Check here my example:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8vRT0lEyNFKK1YGxjZHYJkhsUyS2GRLbHMz2Dw0BcSyQOZZIHCMDZI4hMscImQO0PRYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Data Source" = _t, Amount = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Data Source", type text}, {"Amount", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[#"Data Source"]), "Data Source", "Amount", List.Sum)
in
    #"Pivoted Column"

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

That's exactly what I do and the result is
What I attached

Pivot.JPG








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors