Forum Discussion

butterscotch's avatar
butterscotch
Helper II
2 years ago

Expression.Error: A cyclic reference was encountered during evaluation

Hello,

This is my formula :

let
    Source = Excel.Workbook(File.Contents("**\****\********\*******\******\**"), null, true),
    Project_Table = Source{[Item="Project", Kind="Table"]}[Data],
    Norm_Table = Source{[Item="Norm", Kind="Table"]}[Data],
    
    // Assuming the common column is "Index" in Project table and "Index" in Norm table
    MergedTables = Table.NestedJoin(Project, {"Index"}, Norm, {"Index"}, "NormData"),
    ExpandedNormData = Table.ExpandTableColumn(MergedTables, "NormData", {"Norm value"}, {"Norm value"}),

    // Create a "Total" column by aggregating the multiplication of "YourWeightColumnHere" by "Norm value"
    #"Grouped Rows" = Table.Group(ExpandedNormData, {"Index"}, {{"Total", each List.Sum([#"Weight(MT)"] * [Norm value]), Int64.Type}}),
    
    // Expand the table back to its original structure
    #"Expanded Total" = Table.ExpandTableColumn(#"Grouped Rows", "Total")
in
    #"Expanded Total"

In summary, this code is creating a new table where the data from the "Project" and "Norm" tables are joined based on the common column "Index." The resulting table includes aggregated information, specifically the sum of the product of "Weight(MT)" and "Norm value" for each group of "Index."

but when i try to run the formula i got this error "Expression.Error: A cyclic reference was encountered during evaluation"

I'm still new in Power BI, Thank you so much in advance! 

1 Reply