Understanding Data Type Relationships in Power BI

WendyWang-4750 5 Reputation points
2025-01-02T20:42:20.6733333+00:00

While learning Power BI, the training material states that relationships cannot be created between two columns with different data types. The material quotes:

"During development, you are creating and editing relationships in your model, so when you are building new relationships in your model, regardless of what cardinality you have chosen, always ensure that both of the columns that you are using to participate in a relationship are sharing the same data type. Your model will never work if you try to build a relationship between two columns, where one column has a text data type and another column has an integer data type."

However, during a test, I selected the statement: "Relationships can only be created between columns that contain the same data type," which was marked incorrect. The explanation provided was: "This is not true as relationships can be created between columns that contain different data types in Power BI Desktop." The correct answer stated: "Relationships can be created between tables that contain different types of data," with an explanation that "A working relationship can be created as long as there is at least one common column between them."

This has led to confusion, as it seems the "wrong" answer contradicts the learning material. A more in-depth explanation of this would be helpful.

Community Center Not monitored
{count} vote

1 answer

Sort by: Most helpful
  1. Syed Saleem Peera 13,060 Reputation points Microsoft External Staff Volunteer Moderator
    2025-01-03T04:24:03.59+00:00

    Hi WendyWang-4750,

    Thank you for reaching out on the Microsoft Q&A forum.

    The article referenced says they should be the same data type but does not say they must be the same. It goes on to explain the implications if the data types are different. The knowledge check being challenged is asking what is true, not what is suggested.

    While it recommends matching data types for consistency and accuracy, it acknowledges that different data types can be used but may lead to unexpected behavior or errors. Understanding the potential consequences of using different data types is key to making informed decisions in data management.

    If you are still facing any issue, please let us know in the comments and where you are encountering this error along with the screenshot for reference. We are glad to help you.

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.