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
PBIX: https://drive.google.com/file/d/1qQPbUKYFdpr1FMSLQ5Xf5lMfMszB_8yl/view?usp=sharing
EXCEL: https://drive.google.com/file/d/1WdpHyK54pwY99za2YObX0fCc8tV_QYYB/view?usp=sharing
Hi!
I've looked at more than 10 different posts with similar problems, but the solutions don't seem to work for my dataset. I made a sample set that has the same layout as my actual dataset. I have tried many variations of this code:
with using ALL vs ALLSELECT, EARLIER( [Date] ) vs. MAX( [Date] ), specifying ALL('Sheet2'[Date]), plus combinations of commenting out the [account] and [country] columns. I still don't get the right total in my visual.
It supposed to display the running total by country over time in a stacked column chart, but not by account number, something like this:
But the numbers don't line up between pbi and excel. Filtering the Excel sheet for ukr only, for example, gives a total of -2,463,006.92 for the sum of the amounts, while the Power BI visual gives all sorts of numbers.
Solved! Go to Solution.
Hi @DCELL ,
Or What you want is this?
Measure =
CALCULATE(
SUM(Sheet2[amt]),
FILTER(
ALL(Sheet2),
Sheet2[Country] = MAX(Sheet2[Country])&&
Sheet2[Date] <= MAX(Sheet2[Date])
)
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@DCELL , are you trying for column or measure . This will work for column
Running Test =
CALCULATE(
SUM('Sheet2'[amt]),
FILTER(ALL('Sheet2'),
'Sheet2'[Date] <= EARLIER('Sheet2'[Date] )
&& 'Sheet2'[Country] = EARLIER('Sheet2'[Country] )
&& 'Sheet2'[account] = EARLIER('Sheet2'[account] )
))
Try for measure
Running Test =
CALCULATE(
SUM('Sheet2'[amt]),
FILTER(ALL('Sheet2'),
'Sheet2'[Date] <= max('Sheet2'[Date] )
&& 'Sheet2'[Country] = max('Sheet2'[Country] )
&& 'Sheet2'[account] = max('Sheet2'[account] )
))
@amitchandak , I think in my case a column would be better, but whichever one works, works.
I tried the column and the measure codes you provided but interestingly both gave different totals on the visual.
Hi @DCELL ,
Or What you want is this?
Measure =
CALCULATE(
SUM(Sheet2[amt]),
FILTER(
ALL(Sheet2),
Sheet2[Country] = MAX(Sheet2[Country])&&
Sheet2[Date] <= MAX(Sheet2[Date])
)
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-lionel-msft Your 2nd solution worked!! I had to remove the account column to get past the extra, double aggregation problem as you said
Hi @DCELL ,
According to your formula, I think what you want is the value of [measure] above, so you must add the above 4 fields in your visuals, otherwise the data will be aggregated. This is true even if you create a calculated column.
Maybe you can use a matrix?
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@DCELL can you share pbix file, it is requesting for access.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 123 | |
| 99 | |
| 67 | |
| 49 |