Forum Discussion
Ghaston
Helper I
8 years agoCalculating the difference between a specific month, and the following months
Hi guys. This is my first message in the power bi community. I'm counting on your help I need to calculate for each year, the difference between the stock value of Decembre( the last month of t...
- 8 years ago
Hi@ Ghaston
After my research by your new file,You can use this measure
Column 2 = CALCULATE( SUM( Data[Val.stk va]), FILTER( Data, Data[Groupe marchandises]=EARLIER(Data[Groupe marchandises])&&Data[Year]=EARLIER(Data[Year])&&Data[Month]=EARLIER(Data[Month])))- CALCULATE( SUM( Data[Val.stk va]), FILTER( Data, Data[Groupe marchandises]=EARLIER(Data[Groupe marchandises])&&Data[Year]+1=EARLIER(Data[Year])&&Data[Month]=12))Result:
Here is demo, please try it
Best Regards,
Lin
v-lili6-msft
Community Support
8 years agoHi@ Ghaston
After my research by your new file,You can use this measure
Column 2 =
CALCULATE(
SUM(
Data[Val.stk va]),
FILTER(
Data,
Data[Groupe marchandises]=EARLIER(Data[Groupe marchandises])&&Data[Year]=EARLIER(Data[Year])&&Data[Month]=EARLIER(Data[Month])))-
CALCULATE(
SUM(
Data[Val.stk va]),
FILTER(
Data,
Data[Groupe marchandises]=EARLIER(Data[Groupe marchandises])&&Data[Year]+1=EARLIER(Data[Year])&&Data[Month]=12))Result:
Here is demo, please try it
Best Regards,
Lin
Ghaston
Helper I
8 years agoHi v-lili6-msft
Thanks for the help
Your solution works exactly as i wanted !
Best regards
Ghaston