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

Incorrect "Circular Dependency" error #931

Closed
edhans opened this issue Jun 27, 2023 · 11 comments
Closed

Incorrect "Circular Dependency" error #931

edhans opened this issue Jun 27, 2023 · 11 comments
Assignees
Labels
issue: bug Confirmed as a bug in TE3
Milestone

Comments

@edhans
Copy link

edhans commented Jun 27, 2023

Describe the issue
This is saying that the Snapshot Monthly Compare Index field is dependent upon the Snapshot Monthly Compare Date field and vice versa. This is not correct as far as I can tell. Their code doesn't reference each other (they only reference imported columns) and neither is sorting on the other. The dependency view appears to be correct.

image

image

image

** Which version are you currently using? **
Tabular Editor 3, version: 3.8.0
Tabular Editor 3 edition: Enterprise

To Reproduce
Power BI Service

@edhans
Copy link
Author

edhans commented Jun 27, 2023

Related to this - I am working on a project to eliminate a field from a DIM table so heavily using the Dependency feature. One of the more complex measures rather than fixing it I created a duplicate to ensure I was getting the same results as the original, but no matter what I did, the Dependencies view would not show it, and when I selected that newly duplicated measure and showed what it was dependent upon, it showed nothing. Had to close and reopen TE/3 3.8.0, then it worked fine.

@edhans
Copy link
Author

edhans commented Jun 27, 2023

And now the 'Snapshot 1 Calendar'[Snapshot Monthly Compare Date] field is supposedly referencing itself. It is not. The word "compare" does not appear in the code, so it cannot be referencing itself.
image
Here is the code. I verified the lineage tag is unique.

      `{
        "type": "calculated",
        "name": "Snapshot Monthly Compare Date",
        "dataType": "dateTime",
        "description": [
          "",
          "// controls which snapshot to use for comparison",
          "VAR varMaxMonthSnapshotDate =",
          "    MAXX(",
          "        FILTER(",
          "            'Snapshot 1 Calendar',",
          "            'Snapshot 1 Calendar'[Snapshot Type] = \"M\"",
          "        ),",
          "        'Snapshot 1 Calendar'[Snapshot Date]",
          "    )",
          "VAR varMinMonthSnapshotDate =",
          "    MINX(",
          "        FILTER(",
          "            'Snapshot 1 Calendar',",
          "            'Snapshot 1 Calendar'[Snapshot Type] = \"M\"",
          "        ),",
          "        'Snapshot 1 Calendar'[Snapshot Date]",
          "    )",
          "VAR varMaxDailySnapshotDate =",
          "    MAXX("
        ],
        "isHidden": true,
        "expression": [
          "",
          "/*  controls which snapshot to use for the Monthly comparison only",
          "    cannot be used for the Daily compare */",
          "VAR varMaxMonthSnapshotDate =",
          "    MAXX(",
          "        FILTER(",
          "            'Snapshot 1 Calendar',",
          "            'Snapshot 1 Calendar'[Snapshot Type] = \"M\"",
          "        ),",
          "        'Snapshot 1 Calendar'[Snapshot Date]",
          "    )",
          "VAR varMinMonthSnapshotDate =",
          "    MINX(",
          "        FILTER(",
          "            'Snapshot 1 Calendar',",
          "            'Snapshot 1 Calendar'[Snapshot Type] = \"M\"",
          "        ),",
          "        'Snapshot 1 Calendar'[Snapshot Date]",
          "    )",
          "VAR varMaxDailySnapshotDate =",
          "    MAXX(",
          "        FILTER(",
          "            'Snapshot 1 Calendar',",
          "            'Snapshot 1 Calendar'[Snapshot Type] = \"D\"",
          "        ),",
          "        'Snapshot 1 Calendar'[Snapshot Date]",
          "    )",
          "VAR varCurrentSnapshotDate = 'Snapshot 1 Calendar'[Snapshot Date]",
          "VAR varPreviousMonthlySnapshotDate =",
          "    // What date is the previous monthly snapshot?",
          "    MAXX(",
          "        FILTER(",
          "            'Snapshot 1 Calendar',",
          "            'Snapshot 1 Calendar'[Snapshot Type] = \"M\"",
          "                && 'Snapshot 1 Calendar'[Snapshot Date] < varCurrentSnapshotDate",
          "        ),",
          "        'Snapshot 1 Calendar'[Snapshot Date]",
          "    )",
          "VAR varPreviousDailySnapshotDate =",
          "    // What date is the previous daily snapshot?",
          "    MAXX(",
          "        FILTER(",
          "            'Snapshot 1 Calendar',",
          "            'Snapshot 1 Calendar'[Snapshot Type] = \"D\"",
          "                && 'Snapshot 1 Calendar'[Snapshot Date] < varCurrentSnapshotDate",
          "        ),",
          "        'Snapshot 1 Calendar'[Snapshot Date]",
          "    )",
          "VAR Result =",
          "    SWITCH(",
          "        TRUE(),",
          "        'Snapshot 1 Calendar'[Snapshot Date] = varMinMonthSnapshotDate",
          "            && 'Snapshot 1 Calendar'[Snapshot Type] = \"M\", BLANK(),",
          "        'Snapshot 1 Calendar'[Snapshot Date] = varMaxDailySnapshotDate",
          "            && 'Snapshot 1 Calendar'[Snapshot Type] = \"D\", varMaxMonthSnapshotDate,",
          "        'Snapshot 1 Calendar'[Snapshot Type] = \"M\", varPreviousMonthlySnapshotDate,",
          "        'Snapshot 1 Calendar'[Snapshot Type] = \"D\", varPreviousDailySnapshotDate,",
          "        'Snapshot 1 Calendar'[Snapshot Type] = \"A\", varPreviousDailySnapshotDate",
          "    )",
          "RETURN",
          "    Result"
        ],
        "lineageTag": "289638f5-2216-45d1-bb57-3ae80a7e8fb7"
      },`

Is there some metadata I have messed up?

@otykier
Copy link
Collaborator

otykier commented Jun 28, 2023

Seems like our semantic analysis of the DAX is a bit too sensitive, compared to the real DAX engine in Power BI. Any chance you could share the .bim or .pbit file with us, so we can better investigate? support@tabulareditor.com - thanks!

@otykier otykier added the issue: bug Confirmed as a bug in TE3 label Jun 28, 2023
@otykier
Copy link
Collaborator

otykier commented Jun 28, 2023

Possible related to #920

@edhans
Copy link
Author

edhans commented Jun 28, 2023

Yeah, I saw #920 before posting this, but that was related to NAMEOF().This model does have Field Parameters, but none that are touching the table/fields in question. I will try and get the BIM file to support today.

@tbeswick291
Copy link

I'm seeing the same error. Can't see what's driving the error:
image
image
image
image

@otykier
Copy link
Collaborator

otykier commented Jul 11, 2023

@tbeswick291 are you also only seeing this in the DAX editor (and not in the TOM Explorer and the Messages view)?

@tbeswick291
Copy link

tbeswick291 commented Jul 12, 2023 via email

@otykier
Copy link
Collaborator

otykier commented Jul 12, 2023

@tbeswick291 any chance you could send us the model.bim file, so we can investigate further? support@tabulareditor.com

@tbeswick291
Copy link

@tbeswick291 any chance you could send us the model.bim file, so we can investigate further? support@tabulareditor.com

Sent via email :)

@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 @edhans & @tbeswick291

This is now solved in 3.9.0.
Thank you 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

4 participants