You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
no error
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.
The text was updated successfully, but these errors were encountered:
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!
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:
PS: I know this example doesn't make sense, it's just to make it ieasier to reproduce using contoso/adworks, for example.
The text was updated successfully, but these errors were encountered: