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
Anonymous
Not applicable

Help - Power Query

Hi all,

 

I am a new using power query and I heve the error scenario when I try to execute a test with dataflow:

 

"Expression.Error: A cyclic reference was found during the evaluation."

 

This is my power query:

let
  Origem = OData.Feed("https://testbr.api.crm2.dynamics.com/api/data/v9.1/"null, [Implementation = "2.0"]),
  Navigation = Origem{[Name = "accounts", Signature = "table"]}[Data],
  #"Escolher colunas" = Table.SelectColumns(Navigation, {"accountnumber"}),
  #"Linhas filtradas" = Table.SelectRows(#"Escolher colunas", each [accountnumber] <> null and [accountnumber] <> ""),
  #"Linhas filtradas 1" = Table.SelectRows(#"Linhas filtradas", each Text.Contains([accountnumber], ".") or Text.Contains([accountnumber], "/") or Text.Contains([accountnumber], "-"))
  = Table.ReplaceValue(accounts,".","",Replacer.ReplaceText,{accountnumber}) or Table.ReplaceValue(accounts,"/","",Replacer.ReplaceText,{accountnumber})
or Table.ReplaceValue(accounts,"-","",Replacer.ReplaceText,{accountnumber})
in
  #"Linhas filtradas 1"

 

I am trying to take the special characters of a text (example: "24.462.349/0001-03" to "24462349000103"). But always receive the same error.

 

Thanks in advance!

Rafael Santos

 

 

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

FYI that a quick way to strip the numbers out of a text column is to add a custom column with the Text.Select() function.

 

= Text.Select([Column1], {"0".."9"})

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


lbendlin
Super User
Super User

This part

 

 #"Linhas filtradas 1" = Table.SelectRows(#"Linhas filtradas", each Text.Contains([accountnumber], ".") or Text.Contains([accountnumber], "/") or Text.Contains([accountnumber], "-"))
  = Table.ReplaceValue(accounts,".","",Replacer.ReplaceText,{accountnumber}) or Table.ReplaceValue(accounts,"/","",Replacer.ReplaceText,{accountnumber})
or Table.ReplaceValue(accounts,"-","",Replacer.ReplaceText,{accountnumber})

 

is malformed. Please review. The result is a logical comparison between SelectRows and ReplaceValue. Likely not what you intended.

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.