Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all, I could use some help here.. I want to make a calculation regarding stock values changes between months. Here is the scenario.:
Stock values are stored every 1st day of the month. The first day of the month a balance check is made for last months changes. The user selects the last month, I would like to calculate the difference between the two on the fly by altering the month selected within a variable. The row totals are matching up perfectly. The grand totals are not showing, probabely because these are out of the calculation context.
Here is my formula:
Example of the output:
Tried all sorts of SUMX / SUMMARIZE but can not get it working. The thing is that I also require the totals within other calculations so I could do with your input!
Solved! Go to Solution.
Hi all,
think I got lost in a far to complex approach... After looking at this issue with a fresh mind i figured a simple use of dateadd must do the trick. And sure it did...
Stock Value EOM DateAdd = CALCULATE( [StockValue Start of Month], DATEADD( 'Date'[Date], +1, MONTH ) )
I use this formula all the time somehow i overcomplicated this
Thanks for your contributions!
Hi all,
think I got lost in a far to complex approach... After looking at this issue with a fresh mind i figured a simple use of dateadd must do the trick. And sure it did...
Stock Value EOM DateAdd = CALCULATE( [StockValue Start of Month], DATEADD( 'Date'[Date], +1, MONTH ) )
I use this formula all the time somehow i overcomplicated this
Thanks for your contributions!
Hi @Martin_Leneman ,
Also thanks for your sharing.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
@Martin_Leneman , Try return like below. with addcolumns
return
sumx(addcolumns(summarize(Table, Table[Month], Table[Year], Table[Product]), "_1",Result ),[_1])
Thanks, unfortunately same result:
Stock Value EOM2 =
VAR NextPeriod = IF (SELECTEDVALUE('Appended Sources'[Month]) = 12, 1, SELECTEDVALUE('Appended Sources'[Month]) + 1)
VAR ProdCode = SELECTEDVALUE( 'Appended Sources'[ProductName - Gen] )
VAR Result = CALCULATE(
[StockValue Start of Month] ,
FILTER( ALL ( 'Appended Sources' ), 'Appended Sources'[Month] = NextPeriod),
'Appended Sources'[ProductName - Gen] = ProdCode )
RETURN
sumx(addcolumns(summarize('Appended Sources', 'Appended Sources'[Month], 'Appended Sources'[Year], 'Appended Sources'[ProductName - Gen]), "_1", Result ), [_1])
Hi @Martin_Leneman ,
Could you provide a sample .pbix file for test?
Remember to remove the confidential information.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |