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
Anonymous
Not applicable

dax - circular reference error with two measures using same filter

Hi All,

 

I am trying to create slicers based of sales quantity (no sales) over time. I can create the first measure which works well however if I create a second one with a different date filter I get a circular reference error. Can anyone please let me know how best to resolve this?

 

This works.....

 

No Sales 3 Months =
CALCULATE(
'tablename'[Quantity] == 0, Date[0-12 MonthsFlag] = TRUE()
)
 
If I create another I get the circular reference error:

No Sales 6  to 12 Months =
CALCULATE(
'tablename'[Quantity] == 0, Date[6-12 MonthsFlag] = TRUE()
)
 
Any assistance greatly appreciated. 
5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

You can refer the method in the following links to resolve the problem of circular reference error. If they can't help you resolve the problem, please share with us about the sample data in fact able and the related formula of column [0-12 MonthsFlag] &[6-12 MonthsFlag] in order to provide you a suitable solution.

Circular reference error

Avoiding circular dependency errors in DAX

Best Regards

Anonymous
Not applicable

Thanks Amit,  I cannot make blanks = 0, I need strictly values that  = 0.
I have thousands of records that are blank and thousands that = 0. I only want values that are strictly 0 in value and exlude all that are blank.
I do understand your code in sort but this is not working for me. Kind Regards Fred

Anonymous
Not applicable

 Amit,

 

The first issue I see is that I cannot use Blanks as I have many records that are actually blank and I need to exclude these. I need this to work only when the value is == 0. The second is that I wish to use this measure as a slicer.. as in True or False. I do like your example. Thank you.

@Anonymous , you can try like

Rolling 3 =

var _1= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date]),0),-3,MONTH))+0

 

return

if(_1 =0 , 1, 0)

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
amitchandak
Super User
Super User

@Anonymous , refer to this blog, how can you get no sales by just using ins blank

https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458

 

example

 

Rolling 3 =

var _1=  CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date]),0),-3,MONTH))

 

return

if(isblank(_1), 1, 0)

 


Rolling 6 before 6 =

var _1 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date]),-6),-6,MONTH))

 

return

if(isblank(_1), 1, 0)

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.

Top Solution Authors