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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Raif8522
Frequent Visitor

DAX Formula - Circular dependency errors

Hi,

i have below Table on Power BI which i use it to publish customers' first visit after every 6 months. 

Visit Column: If customer doesn't have any previous visits, show date on the column where visit date matches

 

if(COUNTROWS(filter('Table','Table'[Customer]=EARLIER('Table'[Customer])=0),'Table'[Date],blank()))

 

Visit Suppression End Date Column:  Customers have 180 days suppression period, which visits in that period don't count as visit.

 

if('Table'[Visit]+180,if(DATEDIFF('Table'[Date],MAxx(FILTER('Table','Table'[Customer]=EARLIER('Table'[Customer]) && 'Table'[Trigger?]="Trigger"),'Table'[Date]+180),DAY)<=0,'Table'[Date],Blank()))

 

Trigger? Column: To find if it is a trigger 

 

if('Table'[Visit]<>Blank(),"Trigger",Blank())

 

 

Below is the Current Table:

Raif8522_2-1679875231934.png

After solving the problem, expected Table to be as below:

Raif8522_3-1679875272174.png

The problem is whatever formula or logic i try to find if customer visit on the Date is the visit happened after 6 months from the last triggered visit by suppressing the visits in between, is unsuccesful.

It is easy to find the initial visits and assign the Trigger on the "Trigger?" column but finding following visits, suppressing them and assign it as trigger based on 6 months rule is the problem. 

i am having circular dependency errors whatever i try by using those 3 calculated columns.

 

Any comment or help on the DAX formula from the ecperts will be very helpful for me to overcome this problem.

 

Many Thansk in advance.

 

 

2 REPLIES 2
Raif8522
Frequent Visitor

@amitchandak Hi,

Thanks for your respond. Yeah i am calling calculated column in the formula where the column i using DAX is referencing calculated column.

not sure how i can workaround and come with a formula to calculate if visit date is the first visit after 6 months from the last one

amitchandak
Super User
Super User

@Raif8522 , are you trying to use firstnonblankvalue or lastnonblankvalue ? That may be the reason. or if you are calling a column which is calculated based on this

 

https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.