Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
pzywko01
Regular Visitor

Circular dependency error in Dax measure

Hello,

 

my problem is that I created dependent formulas and I need to keep these dependencies in the model. 

Formulas look as below: 

KF4_a = CALCULATE([KF5_c],PREVIOUSMONTH('Date'[Date].[Date]), ALL())
KF5_a = [KF4_a]+[KF1_a]+[KF8_c]
KF5_b = CALCULATE(SUM('5 closed stock'[Value]), ALL())
KF5_c = CALCULATE(IF(MAX('Date'[Date].[Date])<=NOW(), [KF5_b], [KF5_a]), ALL())
 
 pzywko01_0-1696601572772.png

 

Could you please advise how can I overcome this issue and keep dependencies at the same time? 

 

Thank you in advance!

 
2 REPLIES 2
pzywko01
Regular Visitor

Hi Ibendlin,

 

Here are the definitions of KFs: 

KF1 _a = sales value (this is not calculated but provided in data source)

KF8_a = [KF4_a]-[KF5_c]+[KF1_a]
KF8_b = SUM('8 Sales to pharm'[Values])
KF8_c = IF(MAX('Date'[Date].[Date])>NOW(), [KF8_b], [KF8_a])
 
I tried to create calculated measures with the same logic adding ALLEXCEPT in filters to remove the circular dependency but unfortunately after adding this measure to the matrix with dates and product names it did not show any data 😞 
lbendlin
Super User
Super User

Please show the definitions for [KF1_a] and [KF8_c]

 

One way to avoid circular references is to use calculated columns instead of measures, or to push the calculation upstream to Power Query.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.