tabulartools / dax-optimizer

This repo collects all the issue related to the DAX Optimizer service.
https://app.daxoptimizer.com
3 stars 1 forks source link

Context transition in iterator #15

Closed RonvdLaan closed 1 year ago

RonvdLaan commented 1 year ago

Describe the problem

I think this is not a bug but i get the message Context transition in iterator by using ADDCOLUMNS.

As far as i know is the Context transition required in ADDCOLUMNS

Power BI

September 2023

Steps to reproduce the behavior

No response

Additional context

No response

Screenshots

image

Anything else ?

Is it also possible to analyse the DAX in Calculated columns or calculated tables?

Thanks in advance

Ron van der Laan

marcosqlbi commented 1 year ago

Hi @RonvdLaan - DAX Optimizer reports the Context transition in the iterator issue whenever this could be the source of a performance bottleneck. The idea is that it's better to report a false positive (an issue that is not an issue) rather than a false negative (not detecting a possible issue). I understand that most of the time the ADDCOLUMNS structure is there for the following calculation, and probably it's not there by mistake. However, it's also possible that the cost for ADDCOLUMNS is particularly large, and you want to be informed about that. May I ask you whether the issue is reported for an expensive measure, or has the measure a low relevance? The way to go is to "Ignore" the issue if your recognize you cannot reduce the iteration.

Good point, though - we will evaluate whether to reduce the report for SELECTCOLUMNS/ADDCOLUMNS in case it becomes too noisy.

I keep the issue on GitHub open to collect additional feedback - thanks!

RonvdLaan commented 1 year ago

Hallo Marco,

Here are the statistics for the reported Question. I Ignore the issues and go on with my work. The measure works fine. I checked it in Dax Studio.

Kind Regards, Ron van der Laan

marcosqlbi commented 1 year ago

Did you sent an attachment? It is not included on GitHub, please can you reply on GitHub so I can take a look? Thanks!

RonvdLaan commented 1 year ago

Hallo Marco,

Here is the attachment.

image

marcosqlbi commented 1 year ago

Thank you very much. The issue is reported correctly for the current engine. We will investigate how to split this particular use case (ADDCOLUMNS / SELECTCOLUMNS) from the more generic one because it is less likely to be optimized. In the meantime, I closed this case. Thank you!