Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Automatically updating table references on measured fields

Let's say I create variable which is  sum(field)

 

Powerbi forces me to select the tableA.[columnname] syntax

 

sum(tableA.[columnname])

 

If i upload tableB, I want to be able to rename all tableA references without changing them each manually. 

I want to be able to upload a new csv file for example, and with the new csv file, I dont want to have rename the table reference to the new table.

 

Is there a way to do this?

 

  • Hi @bball3213,

    You cannot dinamically change the calculation of a measure only based on the upload of a file, at most you can use a SWITCH measure however the 2 tables would have to exist in your model.

    If your csv files are the same format you should append them in the same table and use a column to identify the file so then you can filter on it.

    Check out the documentation on creating data from a folder that creates a function that appends files together so any measures will be made on the same table.

    https://docs.microsoft.com/en-us/power-bi/desktop-combine-binaries

    Regards
    MFelix

1 Reply

  • Hi @bball3213,

    You cannot dinamically change the calculation of a measure only based on the upload of a file, at most you can use a SWITCH measure however the 2 tables would have to exist in your model.

    If your csv files are the same format you should append them in the same table and use a column to identify the file so then you can filter on it.

    Check out the documentation on creating data from a folder that creates a function that appends files together so any measures will be made on the same table.

    https://docs.microsoft.com/en-us/power-bi/desktop-combine-binaries

    Regards
    MFelix