March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have a Calendar table like below. Only the last two columns are calculated columns.
Column "IsCurrentMonth " is working fine, DAX as below.
Solved! Go to Solution.
Hi, @SummaL
I can reproduce the same error.
I don't know what exactly causes this error, but after encapsulating the condition with ‘filter’, the code can run normally.
IsCurrentWeek =
VAR currentrowweek = 'Calendar'[Fiscal_Week]
VAR iscurrentweek =
CALCULATE (
MIN ( 'Calendar'[Fiscal_Week] ),
FILTER ( 'Calendar', 'Calendar'[DATE] = TODAY () )
)
RETURN
IF ( iscurrentweek = currentrowweek, "Yes", "No" )
Best Regards,
Community Support Team _ Eason
Hi, @SummaL
I can reproduce the same error.
I don't know what exactly causes this error, but after encapsulating the condition with ‘filter’, the code can run normally.
IsCurrentWeek =
VAR currentrowweek = 'Calendar'[Fiscal_Week]
VAR iscurrentweek =
CALCULATE (
MIN ( 'Calendar'[Fiscal_Week] ),
FILTER ( 'Calendar', 'Calendar'[DATE] = TODAY () )
)
RETURN
IF ( iscurrentweek = currentrowweek, "Yes", "No" )
Best Regards,
Community Support Team _ Eason
@SummaL , same name seems like an issue, try like
IsCurrentWeek =
var _currentrowweek = 'Calendar'[Fiscal_Week]
var _iscurrentweek = CALCULATE(MIN('Calendar'[Fiscal_Week]),'Calendar'[DATE]=TODAY())
return
if (_iscurrentweek=_currentrowweek, "Yes", "No")
If renaming the variables doesn't sort it have a read of
https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
In summary when you use CALCULATE in the second calculated column it causes a context transition and moves all columns from the current row into the filter context. That includes the other calculated columns so they end up being circular.
You need to add ALLEXCEPT into the calculate to reference just the column(s) you need to use.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
83 | |
76 | |
62 | |
58 |
User | Count |
---|---|
141 | |
122 | |
105 | |
94 | |
90 |