Forum Discussion

bdazzler's avatar
bdazzler
New Member
8 years ago
Solved

Adding a relationship changes the field type

Hi all,

 

Powerbi noob here.

 

I have a table (from excel data) called "query_data" and I've created a second table called "summarisedTable".

When they have no relationship between them, they look like this:

 

(note the symbol next to the userCount field, which I assume means that this is a numeric field)

 

However, when I define a relationship between them, the userCount field magically becomes non-numeric:

... which means that I can't use that field in the sankey visualisation that I'm trying to create.

 

Why isn't the field numeric anymore after I've created the relationship?

  • Hi bdazzler,

    Maybe the data type have been changed automatically. Please set the userCount as number type(highlighted in yellow background) and set it summarized by count/sum(box in blue line) as before. So you can use it as before.



    Another way, please right click->Query Editor, and check if there is the changed type step in Query Editor, please remove it and click "Apply&Close", check it the data type is fine.



    Please respond me if you have any other issue.

    Best Regards,
    Angelia

2 Replies

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi bdazzler,

    Maybe the data type have been changed automatically. Please set the userCount as number type(highlighted in yellow background) and set it summarized by count/sum(box in blue line) as before. So you can use it as before.



    Another way, please right click->Query Editor, and check if there is the changed type step in Query Editor, please remove it and click "Apply&Close", check it the data type is fine.



    Please respond me if you have any other issue.

    Best Regards,
    Angelia

    • bdazzler's avatar
      bdazzler
      New Member

      Thanks Angelia - clicking on the column and changing the "Default Summarization" did the trick!