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

Get 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

Reply
Anonymous
Not applicable

Circular Dependency Error

Hi Guys,

 

I am a self-taught power bi user so I kind of still have problems when it comes to creating measures and columns. 

 

I attempted to create a calculated column which shows me vs Previous Month data for our product's SoM and I used the following equation: 

 

Column = Sheet1[SoM2] - CALCULATE(SUM(Sheet1[SoM2]), PREVIOUSMONTH(Sheet1[MONTH].[Date]))
 
However, I keep getting this error
 

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

You could try to use below calculated column to see whether it work or not.

SoM2 = CALCULATE(SUM(Sheet1[Sales]),FILTER(Sheet1, YEAR(Sheet1[MONTH])*100+MONTH(Sheet1[MONTH])= YEAR(EARLIER(Sheet1[MONTH]))*100+MONTH(EARLIER(Sheet1[MONTH]))-1))

I use sheet2 in your sample as dataset. You could refer to my sample for details.

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
dax
Community Support
Community Support

Hi @Anonymous , 

If possible could you please inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @dax

 

I attached the link for the data sample as per your request. 

https://1drv.ms/x/s!Arv02489nwCfasEg-exG0dn1HhM?e=JpYVcf 

Within the dashboard I created a calculated column for the SoM: 

 

SoM2 = Sheet1[Sales (mio)]/CALCULATE(SUM(Sheet1[Mio Sales]),FILTER(Sheet1,Sheet1[MONTH]=EARLIER(Sheet1[MONTH])))
 
and now I am looking to get a vs Previous month between jan and feb, however, as already stated I keep getting the circular dependency error.
 
Thanks!
amitchandak
Super User
Super User

@Anonymous , This seems strange. But anyways, you should prefer to create a date table and join that with you date and use that in previous month

Like

Column = Sheet1[SoM2] - CALCULATE(SUM(Sheet1[SoM2]), PREVIOUSMONTH(Date[Date]))

 

Also in time intelligence do not .Date , Have a date table in case you have time stamp

Column = Sheet1[SoM2] - CALCULATE(SUM(Sheet1[SoM2]), PREVIOUSMONTH(Sheet1[MONTH])) // Not [Date] it is .Date
 New Date = [Month].date

Column = Sheet1[SoM2] - CALCULATE(SUM(Sheet1[SoM2]), PREVIOUSMONTH(Sheet1[New Date]))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi @amitchandak ,

 

Thank you so much for your response. 

 

I tried doing what you suggested but I still keep getting the same error, any idea what could be done?

 

Thanks again for you help!

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi @amitchandak ,

 

I attached the link for the data sample as per your request. 

https://1drv.ms/x/s!Arv02489nwCfasEg-exG0dn1HhM?e=JpYVcf 

Within the dashboard I created a calculated column for the SoM: 

 


SoM2 = Sheet1[Sales (mio)]/CALCULATE(SUM(Sheet1[Mio Sales]),FILTER(Sheet1,Sheet1[MONTH]=EARLIER(Sheet1[MONTH])))

 

and now I am looking to get a vs Previous month between jan and feb, however, as already stated I keep getting the circular dependency error.

 

Thanks!
dax
Community Support
Community Support

Hi @Anonymous , 

You could try to use below calculated column to see whether it work or not.

SoM2 = CALCULATE(SUM(Sheet1[Sales]),FILTER(Sheet1, YEAR(Sheet1[MONTH])*100+MONTH(Sheet1[MONTH])= YEAR(EARLIER(Sheet1[MONTH]))*100+MONTH(EARLIER(Sheet1[MONTH]))-1))

I use sheet2 in your sample as dataset. You could refer to my sample for details.

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.