Call Us

Home / Blog / Power BI / Data types in PowerBI

Data types in PowerBI

  • December 06, 2023
  • 4459
  • 87
Author Images

Meet the Author : Mr. Bharani Kumar

Bharani Kumar Depuru is a well known IT personality from Hyderabad. He is the Founder and Director of AiSPRY and 360DigiTMG. Bharani Kumar is an IIT and ISB alumni with more than 18+ years of experience, he held prominent positions in the IT elites like HSBC, ITC Infotech, Infosys, and Deloitte. He is a prevalent IT consultant specializing in Industrial Revolution 4.0 implementation, Data Analytics practice setup, Artificial Intelligence, Big Data Analytics, Industrial IoT, Business Intelligence and Business Management. Bharani Kumar is also the chief trainer at 360DigiTMG with more than Ten years of experience and has been making the IT transition journey easy for his students. 360DigiTMG is at the forefront of delivering quality education, thereby bridging the gap between academia and industry.

Read More >

Introduction

In the captivating world of data analytics and visualization, the selection of data types in Power BI serves as the bedrock upon which the entire data narrative unfolds. It's not just about numbers; it's a symphony of text, dates, percentages, and geographical coordinates, each playing its unique role in weaving the story of your data. Imagine sculpting your data into rich, multi-dimensional portrayals, where you can paint financial landscapes, map out geographical journeys, or unravel the chronicles of time itself. From the subtle precision of decimals to the binary poetry of Boolean values, Power BI's array of data types is the palette from which you draw your data masterpieces. So, let's embark on this journey through the data types of Power BI, where every choice of data type is a brushstroke in the canvas of insight and understanding.

History

1. Early Versions of Power BI (2013-2015):

  • When Power BI was first introduced in 2013, it primarily focused on providing data visualization and report generation capabilities
  • Data types support was somewhat limited, with a focus on traditional data types like text, numbers, and dates.

360DigiTMG also offers the Data Science Course in Hyderabad to start a better career. Enroll now!

2. Introduction of Advanced Data Types (2015-2016):

  • As Power BI matured, it introduced advanced data types like dates, times, and geographical data, enabling more robust time series analysis and map visualizations.
  • Microsoft enhanced the data modeling capabilities to handle these advanced data types more effectively.

3. Custom Data Types and Power Query (2016-Present):

  • The introduction of Power Query in Power BI Desktop allowed users to shape and transform data during the import process, making it easier to work with various data types.
  • Custom data types could be created in Power Query using the M formula language. This allowed users to define specific data types based on their data sources, providing greater flexibility and accuracy in data processing.

4. Dynamic Data Types (2020-Present):

  • Microsoft introduced dynamic data types in Power BI, allowing users to automatically detect and apply appropriate data types to fields based on the data they contain. This feature simplified the data preparation process.

5. Continuing Enhancements (Ongoing):

  • Microsoft continues to invest in Power BI's data preparation and modeling capabilities. As of my last knowledge update in September 2021, Power BI had an evolving feature set to support a variety of data types, including as text, numbers, dates, times, images, URLs, geographical data, and more.
  • Ongoing updates and enhancements in Power BI are likely to expand the support for data types, making it even more versatile and user-friendly.

Looking forward to becoming a Data Scientist? Check out the Professional Course of Data Science Course in Bangalore and get certified today

Data types in PowerBI

Data types in PowerBI

Text (or Text/String): This data type is used for representing alphanumeric characters, including letters, numbers, and symbols. It's typically used for fields like names, descriptions, and labels.

Whole Number (or Integer): This data type represents whole numbers without decimal points. It's used for fields like counts, quantities, and identifiers.

Decimal Number (or Double): Decimal numbers can have decimal points and are used for fields that require precision, such as monetary values, percentages, and measurements.

Date/Time: This data type is used to store date and time information. It can represent a date, time, or both. Date/time data is often used for time series analysis and date-based visualizations.

Boolean: A boolean data type represents binary values, typically "True" or "False." It's used for fields with yes/no or true/false answers.

Currency: The currency data type is specialized for monetary values. It can include a symbol and formatting specific to currency.

Percentage: This data type is used for fields that represent percentages. It includes a percentage symbol and formatting for percentages.

Whole Number (or Auto-detect): Power BI can automatically detect the data type for a field based on the values it contains. When working with text, this is especially helpful. fields that should be treated as whole numbers.

Duration: Duration data type is used for time-based fields to represent a period of time. It allows calculations and formatting related to time intervals.

Time: The time data type represents a specific time of day. It is used for fields where the time of an event or occurrence is significant.

Geography: Geography data types are used to represent geographical locations, such as cities, countries, or latitude/longitude coordinates. They enable mapping and location-based visualizations.

Image URL: Image URL data types are used to display images in your reports by providing a URL to the image. It allows the embedding of external images in your visuals.

Web URL: Web URL data types are used to create clickable hyperlinks in your reports. You can link to external websites or internal reports and dashboards.

Auto-detect: Similar to the auto-detect whole number, Power BI can automatically detect the data type for a field based on its contents.

Custom Data Types: Using the Power Query M formula language, you can build custom data types in Power BI. These allow you to define specific data types based on your data source.

why we are using PowerBI data types

The Power of Views

Data types in Power BI serve several important purposes in the process of data analysis, reporting, and visualization. Here are the key reasons why we use data types in Power BI:

  • Data Accuracy and Quality: Data types help ensure the accuracy and quality of your data. By specifying the correct data type for each field, you prevent data entry errors, such as entering text in a numeric field, and maintain data consistency.
  • Calculation and Aggregation: Data types play a crucial role in calculations and aggregations. When you define data types accurately, you can perform mathematical operations, date calculations, and aggregations on your data, ensuring the results are meaningful and correct.
  • Data Visualization: Power BI uses data types to determine how to visualize data in charts, tables, and visuals. For example, date data types can be used to create time series visualizations, and geographical data types can be used for mapping.
  • Filtering and Slicing: In Power BI reports, you can filter and slice data based on data types. For instance, you can filter dates within a specific range or use a slicer for selecting categories. Accurate data types are essential for these features to work effectively.
  • Optimized Storage and Performance: Specifying the correct Data type can help optimize storage and improve performance. For example, using integer data types for whole numbers instead of text data types can reduce storage space and improve query performance.
  • Data Validation: Data types are a form of data validation. They help prevent invalid data from being entered or used in calculations. This is especially important in maintaining data integrity.
  • Business Logic and Rules: Data types can represent business logic and rules. For example, a Boolean data type can represent "True" or "False" values for specific conditions or decisions in the data.
  • Custom Formatting: Power BI allows you to apply custom formatting to fields based on their data types. This ensures that data is displayed in reports and visuals in a way that makes sense to users.
  • Data Modeling and Relationships: In a data model, relationships between tables are often based on common data types, such as using a primary key (integer) to link to a foreign key in another table.
  • Data Transformation: When transforming data using Power Query, you can change data types to ensure that your data is in the right format for analysis and reporting.

Are you looking to become a Data Scientist? Go through 360DigiTMG's Data Science Course in Chennai

how can you change the data types in PowerBI

In Power BI, you can change data types using the Power Query Editor. Power Query allows you to transform and shape your data, including modifying the data types of columns. Here's how you can change the data types in Power BI:

1. Load Your Data:

  • Open your Power BI Desktop application.
  • Load your data source by going to "Home" and selecting "Get Data." Choose the appropriate data source (e.g., Excel, SQL Server, Web, etc.).

2. Edit Queries in Power Query:

  • Once your data is loaded, go to the "Home" tab and click on "Edit Queries." This will open the Power Query Editor.

3. Select the Column to Change Data Type:

  • In the Power Query Editor, you'll see a preview of your data and a list of applied steps on the right.
  • Locate the column for which you want to change the data type.

4. Change Data Type:

  • To pick a column, click on its heading.
  • Go to the "Transform" tab in the Power Query Editor.
  • In the "Data Type" dropdown, choose the desired data type. You can select from options like Text, Whole Number, Decimal Number, Date, Time, etc.

5. Apply the Change:

  • Once you've selected the new data type, the change is applied immediately to the column.

6. Close and Load Data:

  • After making all the necessary changes to data types, click "Close & Apply" in the Power Query Editor. This will save the changes and load the data into your Power BI model.

Changing data types in Power Query allows you to ensure that your data is correctly formatted for analysis and visualization. It also helps prevent errors and inconsistencies in your reports and visuals.

Keep in mind that when you change data types, you should verify that the data in the column is compatible with the new data type. For example, if you change a column to a date data type, make sure that all values in the column are indeed valid dates.

Additionally, in the Power BI data model, you can further refine data types and formatting using the Modeling tab in Power BI Desktop, where you can specify display formats, and in DAX (Data Analysis Expressions) calculations.

Conclusion

In the world of data analytics and business intelligence, Power BI's rich and versatile array of data types serves as the very foundation upon which data storytelling is built. It's a journey where numbers, text, dates, and geospatial coordinates come together to weave intricate narratives. Power BI's data types are the vibrant colors on the palette, enabling you to craft insightful visuals and paint vivid stories of business trends, insights, and opportunities.

As you navigate the data landscape, data types are your compass, ensuring that each data point is not merely a statistic but a meaningful piece of the puzzle. They are the guardians of data accuracy, the enablers of precise calculations, and the architects of stunning visualizations. So, whether it's a bar chart that reveals sales trends, a pie chart that showcases market share, or a map that unfolds geographical patterns, Power BI's data types are the storytellers behind every data-driven decision, making the complex world of data elegantly comprehensible.

Data Science Placement Success Story

Data Science Training Institutes in Other Locations

Read
Success Stories
Make an Enquiry