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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
NPR
Frequent Visitor

How to input values into Table row constantly

I need to add values like this :

 

Col1  |  Col2  |  Col3

----------------------

A          B            C

D          E            F

G         H            I  

 

Please help me how to add values into table in PowerBI 

1 ACCEPTED SOLUTION

Hi @NPR ,

 

I created a sample as your required:

08.PNG

Then add below M code:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzmDSBUy6gkk3MOkOJj3ApKdSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
    #"Divided Column" = Table.TransformColumns(#"Added Index", {{"Index", each Number.RoundUp( _ / 3), type number}}),
    #"Added Index1" = Table.AddIndexColumn(#"Divided Column", "Index.1", 1, 1),
    #"Divided Column1" = Table.TransformColumns(#"Added Index1", {{"Index.1", each Number.Mod (_ , 3), type number}}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Divided Column1", {{"Index", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Divided Column1", {{"Index", type text}}, "en-US")[Index]), "Index", "Column1"),
    #"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Index.1"})
in
    #"Removed Columns"

get the result:

09.PNG

Then you can rename the column.

 

Community Support Team _ Dina Ye
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

4 REPLIES 4
PattemManohar
Community Champion
Community Champion

@NPR You mean, how to enter this data into table in Power BI ? If yes, then use "Enter Data" option





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

Proud to be a PBI Community Champion




No, i need to enter data into table horizortally. But (A,B,C,D.........) These items are in one column. Usually we can not add like this. That's why i am trying to add....! 

 

Col1 | Col2 | Col3

-------------------

A        B         C

D        E         F

G        H        I

 

Not like this 

 

Col1 | Col2 | Col3

-------------------

A

B

C

D

E

F

 

 

 

 

Hi @NPR ,

 

I created a sample as your required:

08.PNG

Then add below M code:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzmDSBUy6gkk3MOkOJj3ApKdSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
    #"Divided Column" = Table.TransformColumns(#"Added Index", {{"Index", each Number.RoundUp( _ / 3), type number}}),
    #"Added Index1" = Table.AddIndexColumn(#"Divided Column", "Index.1", 1, 1),
    #"Divided Column1" = Table.TransformColumns(#"Added Index1", {{"Index.1", each Number.Mod (_ , 3), type number}}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Divided Column1", {{"Index", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Divided Column1", {{"Index", type text}}, "en-US")[Index]), "Index", "Column1"),
    #"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Index.1"})
in
    #"Removed Columns"

get the result:

09.PNG

Then you can rename the column.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

@NPR You need to click on the asterisk symbol to create a new column

 

image.png





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

Proud to be a PBI Community Champion




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.