Why does a seemingly small Power BI query consume several gigabytes of memory

0 votes

Why does a seemingly small Power BI query consume several gigabytes of memory?

I’m experiencing high memory usage in Power BI for a seemingly small query and need to understand why this happens and how to optimize queries for better performance.

11 hours ago in Power BI by Evanjalin
• 33,070 points
12 views

1 answer to this question.

0 votes

Numerous performance-affecting factors can lead to high memory usage in Power BI, even for queries that appear to be small. The following are typical causes and tips for query optimization to improve performance:

Typical Reasons for Excessive Memory Use:
Big Data Model:

Power BI can load and process large amounts of data into memory, regardless of the size of the query, if it works with a large dataset or a complex data model (many columns, large tables).

Optimization

Eliminate any tables or columns that are not in use.

When feasible, make use of aggregated tables, also known as summary tables.

By removing unnecessary rows (such as time periods that are no longer required), you can potentially reduce the volume of data.

Complicated computations in queries:

Memory usage can be greatly increased by using Power Query transformations, calculated columns, or complex DAX measures. computations that are done row by row or at a high level of granularity can consume a lot of memory.


Optimization:

  • Break down complex calculations into smaller, more efficient parts.
  • Use calculated columns sparingly in favor of measures, as measures are calculated dynamically and only when needed.
  • Query Folding and Data Transformation:

    • If you are working with large datasets, Power Query may not be able to perform query folding (where transformations are pushed to the source database). This results in more data being loaded into Power BI and then processed in memory.

    • Optimization:

      • Ensure that Power Query steps are foldable (e.g., filter data as early as possible).

      • Avoid doing heavy transformations in Power Query if they can be handled at the data source level.

  • Relationships Between Tables:

    • Power BI might create relationships between large tables, and when processing these tables together, it can cause significant memory consumption.

    • Optimization:

      • Avoid unnecessary relationships between large tables.

      • If possible, use star schema design for your model to reduce the complexity of relationships.

  • Large Granularity in Data:

    • High granularity, such as daily-level data for years or large time-series datasets, can cause Power BI to load many rows of data into memory.

    • Optimization:

      • Aggregate data to a coarser level (e.g., monthly or quarterly) if detailed granularity is not needed.

      • Consider creating indexed tables for faster querying and smaller data loads.

  • Columnar Data Storage:

    • Power BI uses a columnar storage model. If there are highly cardinal columns (e.g., unique IDs or text fields with many different values), it can consume more memory, as Power BI stores values per column rather than row.

    • Optimization:

      • Remove high-cardinality columns if they are not essential to the analysis.

      • Use compression techniques like aggregating or reducing the cardinality of columns when possible.

  • Filters and Contexts:

    • If filters are applied to large datasets or there are many slicers in the report, Power BI might need to load a large amount of data into memory to apply these filters.

    • Optimization:

      • Limit the number of slicers or filters applied in the report.

      • Use direct query mode if the data is extremely large and doesn't need to be stored in memory

answered 11 hours ago by anonymous
• 33,070 points

Related Questions In Power BI

+1 vote
2 answers

Why does a Power BI report look different in Power BI Service compared to Power BI Desktop?

When observing differences in a Power BI ...READ MORE

answered Nov 14, 2024 in Power BI by pooja
• 24,450 points
294 views
0 votes
1 answer

By default, which level of filter behaves as same as a slicer in a report in Power BI desktop?

Hey, There are several types of filters in ...READ MORE

answered Jan 31, 2020 in Power BI by Rakesh
6,618 views
0 votes
1 answer

Power BI: Giving users the option to include or exclude a type of data

The best option, in my opinion, is ...READ MORE

answered Feb 18, 2022 in Power BI by CoolCoder
• 4,420 points
3,926 views
0 votes
1 answer

Why are my Power BI reports taking a long time to refresh, even though the source data has only changed slightly?

Long Power BI refresh times, even due ...READ MORE

answered Dec 18, 2024 in Power BI by anonymous
• 3,020 points

edited Mar 6 371 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,090 points
1,774 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,090 points
3,135 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,938 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Open power bi report nd sign in ...READ MORE

answered Oct 10, 2023 in Power BI by Monika kale

edited Mar 5 2,132 views
0 votes
1 answer

How can I reduce the dataset size of a Power BI model that keeps hitting memory limits on Power BI Service?

In order to shrink the Power BI ...READ MORE

answered Mar 11 in Power BI by anonymous
• 33,070 points
208 views
0 votes
1 answer

Why does my date field show a one-year offset in Power BI Desktop but not in the service?

The issue where a date field shows ...READ MORE

answered 11 hours ago in Power BI by anonymous
• 33,070 points
16 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP