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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

I need to create a dynamic column where i can manually enter data in each row

Hi All,

Can you please help me for the below issue

I want to create "Amount" column in a table in which i can manually enter each value row by row just like we do in excel i.e.

12

1

3

4

Note: Count of rows is dynamic will increase or decrease.

Based on "Amount" we have to calculate "Target". Target=sum of Amount based on Category.

I tried using parameter but issue is not able to add parameter in each row of column.

Is it possible in PowerBI to create a dynamic column where we can manually enter data in each row?

Any help will be appreciated. Thanks

Untitled.png

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

Hi @Anonymous ,

 

Maybe you could try these steps in Power Query.

 

1. Add a Index column to the original table.

 

2. Create a new blank query, below is the steps and the whole M syntax:

new blank query.PNG'

let
    Source = {12,1,3,4},
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Index", 1, 1, Int64.Type),
    #"Renamed Columns" = Table.RenameColumns(#"Added Index",{{"Column1", "Amount"}})
in
    #"Renamed Columns"

You could manually change values by changing this part:

manually change source value.PNG

 

3. Then merge this two tables:

merge queries.PNG

Use Group by sum by each category, the whole M syntax is shown below:

let
    Source = Table.NestedJoin(Table, {"Index"}, Query1, {"Index"}, "Query1", JoinKind.FullOuter),
    #"Expanded Query1" = Table.ExpandTableColumn(Source, "Query1", {"Amount"}, {"Amount"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Query1",{"Index"}),
    #"Grouped Rows" = Table.Group(#"Removed Columns", {"Category"}, {{"Custom", each _, type table [Amount=number]} ,{"Target", each List.Sum([Amount]), type number}  }),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Grouped Rows", "Custom", {"Amount"}, {"Amount"})
in
    #"Expanded Custom"

sum by group.PNG

 

Best Regards,
Eyelyn Qin
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-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Maybe you could try these steps in Power Query.

 

1. Add a Index column to the original table.

 

2. Create a new blank query, below is the steps and the whole M syntax:

new blank query.PNG'

let
    Source = {12,1,3,4},
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Index", 1, 1, Int64.Type),
    #"Renamed Columns" = Table.RenameColumns(#"Added Index",{{"Column1", "Amount"}})
in
    #"Renamed Columns"

You could manually change values by changing this part:

manually change source value.PNG

 

3. Then merge this two tables:

merge queries.PNG

Use Group by sum by each category, the whole M syntax is shown below:

let
    Source = Table.NestedJoin(Table, {"Index"}, Query1, {"Index"}, "Query1", JoinKind.FullOuter),
    #"Expanded Query1" = Table.ExpandTableColumn(Source, "Query1", {"Amount"}, {"Amount"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Query1",{"Index"}),
    #"Grouped Rows" = Table.Group(#"Removed Columns", {"Category"}, {{"Custom", each _, type table [Amount=number]} ,{"Target", each List.Sum([Amount]), type number}  }),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Grouped Rows", "Custom", {"Amount"}, {"Amount"})
in
    #"Expanded Custom"

sum by group.PNG

 

Best Regards,
Eyelyn Qin
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 , You can not do that. You can create a table with Enter data and merge it with this table

How to Enter Data and Edit it: https://youtu.be/5nE7YGT72kU

 

Or can use power app to update the table at source https://community.powerbi.com/t5/Power-Platform-Integrations/Power-Apps-Power-BI-Better-together-Write-Back-From-BI/m-p/1044976#M16

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.