Forum Discussion

Momzi's avatar
Momzi
New Member
1 year ago
Solved

Power BI Measures Automatically Change Column References After Table Load

  After loading new data into Power BI that has a different structure, the measures automatically change their column references even though, after the transformations in Power Query, the final stru...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi,FreemanZ ,thanks for your concern about this issue.

    Your answer is excellent!
    And I would like to share some additional solutions below.

    Hello,Momzi . I am glad to help you.
    I hope my suggestions below are helpful.
    Unfortunately, at the moment for power bi when the data model is changed (e.g. name, table structure modified or new table added), the references to calculated columns and metrics may not all be automatically updated to the correct columns or tables. This is an unavoidable problem.
    In this case, the best thing to do is to manually check and modify the metrics that are causing the problem, or recreate the metrics or calculated columns if necessary.
    You can pay attention to naming conventions when creating calculation columns/measures:
    1. When creating a calculated column, carry the table name with you.

    calclulate column ='Table'[column 1]


    2. When creating a measure, try not to carry the name of the table

    measure = MAX([column 1])

    By following a naming convention, the risk of referencing errors can be somewhat minimized. Additionally, maintaining consistent naming conventions and regularly checking the metrics and calculated columns in your model can help ensure the stability and accuracy of your data model.

    I hope you find the following related links helpful.

    URL:Automate the best practice of proper column & measure references

    Similarly, you can use external tools to assist you in checking changes in the data model.
    Using the Tabular Editor is a good option.
    It not only allows you to check the structure of a table model with a set of metrics and calculated columns, but also helps you to optimize the whole model (calculating how efficiently they work and how much memory they take up).

    URL:
    https://github.com/otykier/TabularEditor/releases
    https://www.sqlbi.com/tools/vertipaq-analyzer/
    Solved: Best Practice: Data has changed column names, how ... - Microsoft Fabric Community
     


    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Carson Jian,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.