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
If you create measures in a calculated table, then script the table, the measure is put at the top of the script.
If you later run the script where the table doesn't exist, you get an error because TE/3 has no where to put the measures because the referenced table doesn't exist.
If you move Measures to the bottom of the DAX script, it works fine though. The below script in a Contoso database will fail because the "Test CG" calc group doesn't exist at the time the measure script lines are run, but this is the code and order that TE/3 created when I scripted the CG with the measure in it.
---------------------------
-- Measure: [Measure in CG]
---------------------------
MEASURE 'Test CG'[Measure in CG] = SELECTEDVALUE('Product'[Product Name]) IN VALUES('Product'[Brand])
-------------------------------
-- Calculation Group: 'Test CG'
-------------------------------
CALCULATIONGROUP 'Test CG'[Name]
CALCULATIONITEM "The Doubler" = SELECTEDMEASURE() * 2
Tabular Editor 3 Version
3.19
Screenshots
No response
Steps to Reproduce
No response
Expected behavior
No response
Crash Report
No response
Windows Version
No response
The text was updated successfully, but these errors were encountered:
edhans
changed the title
Put Measures at end of DAX Scripts when scripting calculated tables (Field Parameters, Calculation Groups, etc.
Put Measures at end of DAX Scripts when scripting calculated tables (Field Parameters, Calculation Groups, etc.)
Jan 23, 2025
Description
If you create measures in a calculated table, then script the table, the measure is put at the top of the script.
If you later run the script where the table doesn't exist, you get an error because TE/3 has no where to put the measures because the referenced table doesn't exist.
If you move Measures to the bottom of the DAX script, it works fine though. The below script in a Contoso database will fail because the "Test CG" calc group doesn't exist at the time the measure script lines are run, but this is the code and order that TE/3 created when I scripted the CG with the measure in it.
Tabular Editor 3 Version
3.19
Screenshots
No response
Steps to Reproduce
No response
Expected behavior
No response
Crash Report
No response
Windows Version
No response
The text was updated successfully, but these errors were encountered: