Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DETAILROWS column references appear as error (intellisense) when used within a measure #938

Closed
natolira opened this issue Jul 5, 2023 · 2 comments
Assignees
Labels
issue: bug Confirmed as a bug in TE3
Milestone

Comments

@natolira
Copy link

natolira commented Jul 5, 2023

DETAILROWS is an sub-optimal alternative (maybe not so suboptimal) alternative to have table measures within DAX.

So, if you have a complex logic that needs to be added to several measures, it's better (at least thinking about maintenability) to have a single place to create/update the code and use it to other measures.

I'm currently using version 3.4.2 (yes, I need to update), but I'm pretty sure this issue persists at 3.8.0

To reproduce you need to set DETAILROWS expression that returns a table, let's say at Measure [MyTableMeasure] that has something like:
ADDCOLUMNS(
ALLSELECTED('Dates'[Date]),
"@sales", [Sales Amount]
)

So, I can create a measure:
Total Sales (external filters only) =
SUMX(
DETAILROWS([MyTableMeasure]),
[@sales]
)

And it works fine. The issue is that when I open Tabular editor, I see several intellisense error messages saying that

"The value for [@sales] cannot be determined. Either [@sales] doesn't existe or there is no current row for a column named [@sales]."

The expected behaviour is that:

  1. no error
  2. even better, intellisense recognizes [@sales] as a column of the table DETAILROWS([MyTableMeasure])

PS: I know this example doesn't make sense, it's just to make it ieasier to reproduce using contoso/adworks, for example.

@otykier
Copy link
Collaborator

otykier commented Jul 5, 2023

Yup, that's a bug, still in 3.8.0. Our DAX parser currently doesn't propagate the static analysis of the detail rows expression to expressions that use DETAILROWS. We'll make sure that's fixed in an upcoming release. Thanks for reporting!

@otykier otykier added the issue: bug Confirmed as a bug in TE3 label Jul 5, 2023
@otykier otykier added this to the 3.9.0 milestone Jul 14, 2023
@DBojsen DBojsen self-assigned this Jul 18, 2023
@DBojsen
Copy link
Collaborator

DBojsen commented Jul 24, 2023

Hi @natolira

This is now fixed in 3.9.0.
Thanks for reporting.

BR David - TE3 Support

@DBojsen DBojsen closed this as completed Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Confirmed as a bug in TE3
Development

No branches or pull requests

3 participants