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

Unhandled Exception Keeps Occurring in Debugger #984

Closed
fleetteamSD opened this issue Sep 6, 2023 · 2 comments
Closed

Unhandled Exception Keeps Occurring in Debugger #984

fleetteamSD opened this issue Sep 6, 2023 · 2 comments
Assignees
Labels
issue: bug Confirmed as a bug in TE3
Milestone

Comments

@fleetteamSD
Copy link

fleetteamSD commented Sep 6, 2023

Describe the issue
When I start a debugging session in one particular report for some complex DAX, the debugger keeps crashing.

** Which version are you currently using? **
Tabular Editor 3, version: 3.10.0.38702
Tabular Editor 3 edition: Desktop

To Reproduce
Power BI

Steps to reproduce the behavior:

  1. Click on File | New | New DAX Query
  2. Copy in DAX Query and execute
  3. Right-click on cell and select "Debug"; debugger opens
  4. As soon as I hit the line that says "__value" in the Measure [Expense % Change Total], the debugger crashes.

Expected behavior
Step through the following queries:

-----------------------------------
-- Measure: [Earliest Expense Date]
-----------------------------------
MEASURE '01 Measures'[Earliest Expense Date] = 
    MINX (
            'Cost Avoidance High Expense',
            'Cost Avoidance High Expense'[Invoice or Approval Date]
        )

--------------------------------------------
-- Measure: [Earliest Expense Amount Single]
--------------------------------------------
MEASURE '01 Measures'[Earliest Expense Amount Single] = 
    VAR EarliestDate = [Earliest Expense Date]
    
    VAR Result =
        CALCULATE (
        MAX ( 'Cost Avoidance High Expense'[Total Invoiced] ),
        FILTER (
            ALL ( 'Cost Avoidance High Expense'[Invoice or Approval Date] ),
            'Cost Avoidance High Expense'[Invoice or Approval Date] = EarliestDate
        )
    )
    
    RETURN
        Result

---------------------------------
-- Measure: [Latest Expense Date]
---------------------------------
MEASURE '01 Measures'[Latest Expense Date] = 
    MAXX (
            'Cost Avoidance High Expense',
            'Cost Avoidance High Expense'[Invoice or Approval Date]
        )

------------------------------------------
-- Measure: [Latest Expense Amount Single]
------------------------------------------
MEASURE '01 Measures'[Latest Expense Amount Single] = 
    VAR LatestDate = [Latest Expense Date]
    
    VAR Result =
       CALCULATE (
        MAX ( 'Cost Avoidance High Expense'[Total Invoiced] ),
        FILTER (
            ALL ( 'Cost Avoidance High Expense'[Invoice or Approval Date] ),
            'Cost Avoidance High Expense'[Invoice or Approval Date] = LatestDate
        )
    )
    
    RETURN
        Result

----------------------------------------------
-- Measure: [Expense Amount Difference Single]
----------------------------------------------
MEASURE '01 Measures'[Expense Amount Difference Single] = 
    VAR EarliestAmount = [Earliest Expense Amount Single]
    VAR LatestAmount = [Latest Expense Amount Single]
    
    VAR Result =
    SUMX (
            VALUES('Cost Avoidance High Expense'[Asset.Name]),
            EarliestAmount - LatestAmount
        ) * -1
    
    RETURN
        Result

---------------------------------------------
-- Measure: [Expense Amount Difference Total]
---------------------------------------------
MEASURE '01 Measures'[Expense Amount Difference Total] = 
    VAR __table = 
    SUMMARIZE(
        'Cost Avoidance High Expense',
        [Asset.Name],
        "__value",
        [Expense Amount Difference Single])
    RETURN
        IF(
            HASONEVALUE(
                'Cost Avoidance High Expense'[Asset.Name]
            ),
            [Expense Amount Difference Single],
            SUMX(
                __table,
                [__value]
            )
    )

-------------------------------------------
-- Measure: [Earliest Expense Amount Total]
-------------------------------------------
MEASURE '01 Measures'[Earliest Expense Amount Total] = 
    VAR __table = 
    SUMMARIZE(
        'Cost Avoidance High Expense',
        [Asset.Name],
        "__value",
        [Earliest Expense Amount Single])
    RETURN
        IF(
            HASONEVALUE(
                'Cost Avoidance High Expense'[Asset.Name]
            ),
            [Earliest Expense Amount Single],
            SUMX(
                __table,
                [__value]
            )
    )

-------------------------------------
-- Measure: [Expense % Change Single]
-------------------------------------
MEASURE '01 Measures'[Expense % Change Single] = 
    //VAR Percent_Change = DIVIDE([Expense Amount Difference Single], [Earliest Expense Amount Single], 0)
    VAR Percent_Change = DIVIDE([Expense Amount Difference Total], [Earliest Expense Amount Total], 0)
    
    VAR Result = 
        SWITCH(
            TRUE(),
            [Expense Amount Difference Single] < 0, Percent_Change * -1,
            Percent_Change
        )
    
    RETURN
        Result

------------------------------------
-- Measure: [Expense % Change Total]
------------------------------------
MEASURE '01 Measures'[Expense % Change Total] = 
    VAR __table = 
    SUMMARIZE(
        'Cost Avoidance High Expense',
        [Asset.Name],
        "__value",
        [Expense % Change Single])
    
    VAR Sub_Result = 
    IF(
            HASONEVALUE(
                'Cost Avoidance High Expense'[Asset.Name]
            ),
            [Expense % Change Single] * -1,
            /*SUMX(
                __table,
                [__value]
            )*/
            [Expense % Change Single]
    )
    
    RETURN
        VAR Result = 
            SWITCH(
                TRUE(),
                [Expense Amount Difference Total] < 0, Sub_Result * -1,
                Sub_Result 
            )
    
    RETURN
        Result

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Windows version: 10

Additional context
Error report:
Tabular Editor Unhandled Exception Error Report

Tabular Editor version: 3.10.0 (3.10.0.38702)
OS version: Microsoft Windows NT 10.0.19045.0
Model details:
CompatibilityLevel: 1567
CompatibilityMode: PowerBI
IsPbiDesktop: True
SourceType: Database
TableCount: 97
FirstTimeModelLoad: False
DatabaseNameSHA256: 4ffcbf23abdcc5a00553f1fa1e2045562cdd45976b1c1f13
ServerVersion: 16.0.92.17
ServerLocation: OnPremise
ServerProductLevel: RTM
ServerProductName: Microsoft SQL Server Analysis Services
ServerEdition: Enterprise64
ServerNameSHA256: c002e9abdc4d23c1bc7ac70a3c1b8f5ea3e2d4e34f6757d4
User description:
Exception message: Object reference not set to an instance of an object.
Exception source: Dax.Debugger
Stack trace: at Dax.Debugger.CallStackItem.GetNameForItem(DaxInfo infoCache)
at Dax.Debugger.CallStackItem..ctor(IDebugSession session, AbstractContext context, Boolean persisted, DaxInfo infoCache, DaxBaseNode generatingNode)
at Dax.Debugger.EvaluationContextStack.AssignFromNodeInternal(CallTreeNode node, DaxInfo infoCache)
at Dax.Debugger.EvaluationContextStack.AssignFromNode(CallTreeNode node, DaxInfo infoCache)
at Dax.Debugger.DebugSession.CallTree_CurrentChanged(Object sender, EventArgs e)
at Dax.Debugger.CallTree.set_Current(CallTreeNode value)
at Dax.Debugger.DebugStepper.set_CurrentCall(CallTreeNode value)
at Dax.Debugger.DebugStepper.StepOver()
at Dax.Debugger.DebugStepper.StepIn()
at TabularEditor.UI.Utils.SimpleLink.ExecuteLink()
at TabularEditor.UI.Utils.SimpleLink.Click(Object sender, EventArgs e)
at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarBaseButtonItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarButtonItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarItemLink.OnLinkClick()
at DevExpress.XtraBars.BarButtonItemLink.OnLinkClick()
at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.ClickLink(BarItemLink link)
at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraEditors.XtraControl.WndProc(Message& m)
at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)
at DevExpress.XtraBars.Controls.DockedBarControl.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)
Modules loaded:
TabularEditor3.dll

@mlonsk mlonsk added the issue: under review Being looked into by TE team label Sep 13, 2023
@mlonsk mlonsk self-assigned this Sep 13, 2023
@mlonsk mlonsk added issue: bug Confirmed as a bug in TE3 and removed issue: under review Being looked into by TE team labels Sep 13, 2023
@mlonsk
Copy link
Collaborator

mlonsk commented Sep 13, 2023

Hi @fleetteamSD
We will look into fixing this bug. Thank you for reporting

@mlonsk mlonsk added this to the 3.11.0 milestone Sep 19, 2023
@otykier
Copy link
Collaborator

otykier commented Sep 25, 2023

Fixed in 3.11.0. Thanks for reporting!

@otykier otykier closed this as completed Sep 25, 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