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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
donaldo
Helper III
Helper III

Calculate split sum within this year and next year

Hi,

 

I have a main table with projects with ID's. They are related one-to-many to another table like this

 

ID	Month	Sales
A	okt-18	10
A	nov-18	10
A	dec-18	10
A	jan-19	10
A	feb-19	10
A	mar-19	10

Now I want to make a column called "Savings this Year", that for Project A will sum all sales within YEAR(TODAY()) and another column for all savings contained within YEAR(TODAY())+1. I managed to do the first column via my Date Table by the following, with correct and working numbers:

 

Savings in this year = CALCULATE(SUM(SavingsDistribution[Saving ('000)]);'Date Dimensions'[Year]=YEAR(TODAY()))

 

If I try to create the Next Year column I get an error related to dependency:

A circular dependency was detected: Idea[Column], Idea[Savings in this year], Idea[Column].

How can I either avoid this or do it in another way?

1 ACCEPTED SOLUTION

Hi @donaldo

 

The error is because you used two calculate function in two columns. Here is the article about this reason. Here is the article about avoiding-circular-dependency-errors-in-dax. In this case, measure would be better then calculated column.

 
Regards,
Cherie
 
Community Support Team _ Cherie Chen
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

3 REPLIES 3
v-cherch-msft
Employee
Employee

Hi @donaldo

 

You may create a measure as below. Attached the sample file for your reference.If it is not your case,please share your sample data which could reproduce your scenario so that we could help further on it.

Savings Next Year =
CALCULATE (
SUM ( SavingsDistribution[Sales] ),
'Date Dimensions'[Year]
= YEAR ( TODAY () ) + 1
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey v-cherch-msft,

 

Thanks for your help!
It worked as a measure. It's the same DAX as my first column. Do you have any idea as to what is wrong so that it can't be columns?

Hi @donaldo

 

The error is because you used two calculate function in two columns. Here is the article about this reason. Here is the article about avoiding-circular-dependency-errors-in-dax. In this case, measure would be better then calculated column.

 
Regards,
Cherie
 
Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors