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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper III

## Calculate column with value of different lines

Hello guys, how are you?

I try make a calculate column that showing a value of other column after filter, but I need filter for information of line and put at the cell an information of other line:

I need to put in the column calculate the information of H0xH1, but I need to filter by Topology Validation, happen that at the line that H0xH1 has information, Validação Topologia don’t has information, I need get a information the under line, but I don’t know how make, somebody can help me.

Thank you all.

1 ACCEPTED SOLUTION
Super User

Each step in Power Query can reference some other step.  In this case the step is referencing a step called "Source"  which is not present in your code (likely because you use the portuguese word for it).

You may want to invest some time in learning Power Query basics.

9 REPLIES 9
Super User

Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helper III

Hello @lbendlin I will try explaining with clear data:

 Data 1 Data 2 Data 3 Data Results 1 00 00-25 1 25 00-25

Data 1- In this cell must contain the information of device identification of my analysis;

Data 2 - In this cell must contain an information of others that I need;

Data 3 - In this cell must contain an information of others that I need;

Data Result - This cell I need make a form that should merge the information of column Data 3 with Data 2;

My problem is that in the line that Data 3 have information, Data 2 haven’t, or if Data 2 have information, Data 3 haven’t, how I need merge information of distinct lines I don’t know make this.

You can help me?

Thanks for attention

Super User
``````let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIwABIKYIaukalSrA5EGCQC5MKFYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Data 1" = _t, #"Data 2 " = _t, #"Data 3 " = _t, #"Data Results" = _t]),
#"Replaced Value" = Table.ReplaceValue(Source," ",null,Replacer.ReplaceValue,{"Data 2 ","Data 3 "}),
#"Added Custom" = Table.AddColumn(#"Replaced Value", "Results", each List.First(List.RemoveNulls(#"Replaced Value"[#"Data 2 "])) & "-" & List.First(List.RemoveNulls(#"Replaced Value"[#"Data 3 "])))
in
#"Added Custom"``````

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

Helper III

Ok @lbendlin thank for answer, but I need put my data using this code, how I make it?

Thanks for all supporting.

Super User

replace the Source= step with your own.

Helper III

Hello @lbendlin  I try but show me a error, I think that I don't make way correct, which step I do cut for put my code?

Thanks for supporting!

Super User

this part

``````let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIwABIKYIaukalSrA5EGCQC5MKFYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Data 1" = _t, #"Data 2 " = _t, #"Data 3 " = _t, #"Data Results" = _t]),``````

Helper III

Ok @lbendlin  after step, I see this error:

Expression.Error: O nome 'Source' não foi reconhecido. Certifique-se de que ele foi soletrado corretamente.

At the Power Query = Table.ReplaceValue(Source," ",null,Replacer.ReplaceValue,{"Data 2 ","Data 3 "})

I do not know what to do.

Super User

Each step in Power Query can reference some other step.  In this case the step is referencing a step called "Source"  which is not present in your code (likely because you use the portuguese word for it).

You may want to invest some time in learning Power Query basics.

## Helpful resources

Announcements

#### New forum boards available in Real-Time Intelligence.

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

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors