IsAvailableInMDX: not just an Excel setting

The short version

There is a property in Power BI semantic models you can set per column called IsAvailableInMDX. When most people discuss this property, the first question often asked is, “Are you using Excel to query the semantic model?”. If the answer is no, the usual follow up is “turn it off everywhere, you will save memory and your refresh will be faster”.

For Import models, turning it off can save memory by removing a supporting structure from a column. But a DAX query may have been making good use of that structure, particularly when filtering the column. Direct Lake is different: it uses its column dictionary for these DAX optimisations, but the setting still matters for Excel field availability.

Do I benefit? In Import models, a numeric column used only for totals, such as SUM, is a good candidate for testing with the setting off. Keep it on for columns used to filter or group your data, including filters inside measures. For Direct Lake, leave it off unless the column needs to be available as an Excel/MDX field. In either mode, keep it on if people need that column for PivotTable rows, columns or filters.

Do I need to change anything? This is a per-column model setting, not a new DAX function. There is no need to switch it off everywhere just because nobody uses Analyze in Excel.

What is the catch? In Import, removing the structure can make some queries slower. In both Import and Direct Lake, turning the setting off removes the column as an Excel/MDX field, although explicit measures can still use it. Do not assume Import memory savings carry over to Direct Lake.

How do I check? Compare model size and query time before and after, using the same data and queries. Check CPU and returned values too. If people use Excel, test their PivotTables as well.

The deeper dive

The example that prompted this post

A colleague recently got in touch about a very large Import semantic model. The team had made several changes to reduce its memory footprint. One was to turn off IsAvailableInMDX on columns that were not needed for Analyze in Excel.

The model was smaller, but some measures had become much slower.

They narrowed one problem down to a text column in a large fact table. A DAX calculation was applying a filter to that column. With IsAvailableInMDX set to True, the query was faster. With it set to False, the same calculation took much more work.

The query was DAX in both cases. The surprise was that a setting with “MDX” in its name made a difference.

What was the setting keeping?

The supporting structure is called an attribute hierarchy. It is not a hierarchy you manually create in the report, such as Year, Quarter and Month.

The property controls whether a column is available as an Excel/MDX field. In Import models, the attribute hierarchy also helps DAX with filtering and grouping. It can help the engine choose a more efficient way to find the rows a query needs. It is much more efficient to scan an attribute hierarchy than do a string search on a large column.

In the reported example, removing the attribute hierarchy changed how a text filter was handled, making the query slower. Keeping it was useful even though that calculation had nothing to do with Excel. It does not follow that turning it on makes every query faster.

The structure also takes memory. There was no isolated before-and-after size measurement for this one setting in the material I reviewed, so I would not attach a memory-saving percentage to it. The overall model reduction came from several changes.

Choose by how the column is used

For an Import model, take a sales amount that is only ever added up. That is a reasonable place to test turning the setting off. The underlying values remain, and an explicit SUM measure can still use them. An Excel PivotTable can still use that measure; using the amount column itself on its rows or columns is a different requirement.

Now take a product category, a date, or a reference code used to select rows. Keep the setting on for that column, whether the filter comes from a slicer or from DAX inside a measure.

A measure can sum one column and filter another. Treat those columns separately. A hidden column can still be doing important work in a filter. A small dimension can matter too: its filter can affect how the engine processes a much larger fact table.

What about Direct Lake?

Direct Lake takes a different route for the DAX optimisations discussed here. It can use the column’s dictionary, a list of its distinct values, rather than depending on the Import-style attribute hierarchy. You do not need to turn this property on just to obtain that DAX benefit.

That does not make the property pointless. Set it to false and the column is no longer available as a field for Excel PivotTable rows, columns or filters. This applies to both Import and Direct Lake. An explicit DAX measure can still use the column, and Power BI visuals can still filter or group by it.

For Direct Lake, leave it off if the column is not needed as an Excel/MDX field; keep it on if it is. This is not a promise of the same memory saving as Import, or a switch that removes Direct Lake’s dictionary and loading costs.

At a glance

Storage modeIsAvailableInMDXDAX behaviourExcel PivotTable field
ImporttrueThe hierarchy is available to help filtering and grouping. It uses memory, but not every query benefits.Available, subject to the column’s other visibility settings.
ImportfalseCan save hierarchy memory. Aggregation-only columns are candidates; filters and group-bys may become slower.Not available as a field.
Direct LaketrueUses the dictionary for the DAX optimisations discussed here; the setting is not needed for that benefit.Available, subject to the column’s other visibility settings.
Direct LakefalseStill uses that dictionary-based route. Do not expect the same memory saving as Import.Not available as a field.

“Not available as a field” means you cannot use the column itself on Excel PivotTable rows, columns or filters. An explicit DAX measure can still use it in either storage mode. Turning the property off does not hide the column from Power BI visuals or prevent DAX from filtering or grouping by it. The table describes the trade-offs, not a guaranteed speedup.

The model design still matters

In this case, the colleague also reported that moving the filter to the related dimension improved query time. The team was checking whether that change fitted the model’s requirements.

That is worth considering when a calculation repeatedly picks apart text in a large fact table. A proper date or other meaningful attribute in a dimension may be a better way to express the filter.

Test that separately from changing IsAvailableInMDX, so you know which change helped.

Where to turn it on or off

Use a test copy of your model. The same property is available for Import and Direct Lake columns, but the reasons for changing it differ as described above. In Power BI Desktop, open TMDL view and drag the column from the Data pane into the editor. This generates its definition for you.

Inside that column’s definition, find or add this property:

isAvailableInMdx: false

Use false to turn it off, or true to turn it back on. This is one property line, not a complete script. Keep the rest of the generated definition and its indentation. For Import, refresh or process the affected table as required before measuring the hierarchy change.

Select Preview and check that only the intended property on the intended column changes. Then select Apply and save your changes. Apply changes the metadata; refresh or process the model as required before comparing size and performance.

Tabular Editor also exposes this property when you select a column, if that is your preferred tool.

A small test before a large change

For an Import model, record a baseline before changing the setting, then compare the processed model using the same data and queries.

VertiPaq Analyzer can show the hierarchy’s size. DAX Studio’s Server Timings can show whether your queries became faster or slower and how much CPU they used. Include real report filters, grouped results and totals, not just a single unfiltered SUM. Keep data, security and cache conditions comparable.

Test in the storage mode you actually use. With Direct Lake, distinguish a query that needs to load data from one whose data is already in memory. Do not assume that a result from an Import model transfers unchanged.

If you have already turned the property off broadly in an Import model, start by reviewing the columns used in filters and group-bys. They may deserve it back, even if nobody opens Excel. In either storage mode, also check any columns that people need as Excel PivotTable fields.

Further reading

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments