Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
If I write this formula in a measure, I get the good result as it calculates the amount of sales for the next year.
Solved! Go to Solution.
Hi @jsteffe ,
It is because of the row context,you need to correct your expression as below:
CALCULATE(SUM(Sales[amount]),'Sales',NEXTYEAR('Calendar'[Date]))
Hi @jsteffe ,
It is because of the row context,you need to correct your expression as below:
CALCULATE(SUM(Sales[amount]),'Sales',NEXTYEAR('Calendar'[Date]))
Because you are in Row context, you likely need to break out of row context using ALL.
CALCULATE(SUM(ALL(Sales[amount]));NEXTYEAR('Calendar'[Date]))
Hi Greg,
Your proposal :
CALCULATE(SUM(ALL(Sales[amount]));NEXTYEAR('Calendar'[Date]))
doesn't work because the first parameter of SUM function requires the name of a column.
I created a table Calendar and a relationship between this table and my table Sales. That's why in the row context I thought that this formula will calculate for each row the total amount of sales for the next year (of my actual row)
Hi @jsteffe ,
Have you tried my measure?I have tested here and it works.
Sorry I did'nt see your reply.
It perfectly works. Thanks.