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

DAX Debugger Generate query / Zoom button #770

Closed
corycundy opened this issue Dec 21, 2022 · 1 comment
Closed

DAX Debugger Generate query / Zoom button #770

corycundy opened this issue Dec 21, 2022 · 1 comment
Labels
issue: bug Confirmed as a bug in TE3
Milestone

Comments

@corycundy
Copy link

Within AdventureWorks, if you run the following query and add 'Date' as a table in the Watch Window, it will generate the DAX query below which is invalid.

// DAX Query
DEFINE
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL('Date'[Calendar Year], "IsGrandTotalRowTotal"),
"Internet_Total_Sales", 'Internet Sales'[Internet Total Sales]
)

VAR __DS0PrimaryWindowed =
TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'Date'[Calendar Year], 1)

EVALUATE
__DS0PrimaryWindowed

ORDER BY
[IsGrandTotalRowTotal] DESC, 'Date'[Calendar Year]

It appears to double up portions of the query. If I delete the code from the first EVALUATE to just before the second EVALUATE, it works.

---------Invalid Generated DAX for the 'Date' table

// DAX Query
DEFINE
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL('Date'[Calendar Year], "IsGrandTotalRowTotal"),
"Internet_Total_Sales", 'Internet Sales'[Internet Total Sales]
)

VAR __DS0PrimaryWindowed =
TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'Date'[Calendar Year], 1)

EVALUATE // DAX Query
DEFINE
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL('Date'[Calendar Year], "IsGrandTotalRowTotal"),
"Internet_Total_Sales", 'Internet Sales'[Internet Total Sales]
)

VAR __DS0PrimaryWindowed =
TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'Date'[Calendar Year], 1)

EVALUATE CALCULATETABLE('Date',TREATAS({2014},'Date'[Calendar Year]))

@otykier otykier added the issue: bug Confirmed as a bug in TE3 label Dec 22, 2022
@otykier otykier added this to the 3.4.0 milestone Dec 23, 2022
@otykier
Copy link
Collaborator

otykier commented Dec 23, 2022

This is now fixed in 3.4.0. Thanks for reporting!

@otykier otykier closed this as completed Dec 23, 2022
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

2 participants