Forum Discussion

cn4422's avatar
cn4422
Helper V
3 months ago
Solved

Power Query or Calculated columns

Hi, I have a an account-table with numerous columns and I now need to creat flag-columens (logic true/false) --> I'm not sure if it's better to create them directly with m-code or add them as calcul...
  • v-menakakota's avatar
    v-menakakota
    3 months ago

    Hi,

    Thank you for contacting the Microsoft Fabric community forum.

     

    Thanks for sharing the full query, this gives much better context on the refresh behavior. Based on the code shared, moving the flag columns from Power Query to DAX calculated columns would likely not provide significant benefit, since most of the flags are simple row-level checks that are generally suitable for Power Query transformations during the ETL stage.

     

    The query also contains multiple `Table.Group`, `Table.NestedJoin`, normalization, and buffering operations. Microsoft documentation notes that transformations, joins, grouping operations, and query folding behavior can affect refresh performance depending on the source and transformation sequence.

     

    Your current country mapping approach using `Record.FieldOrDefault` is also a valid approach for smaller mapping lists.

     

    Please refer the below documents

     

    Understanding Query Evaluation and Query Folding in Power Query - Power Query | Microsoft Learn

    Query folding indicators in Power Query - Power Query | Microsoft Learn

    Use Calculation Options in Power BI Desktop - Power BI | Microsoft Learn

     

    If I’ve misunderstood your needs or if you still encounter issues, please let us know.

    Best Regards, 
    Community Support Team