This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello,
I trying to get a cumulative total working for profit and loss, very similar to that found at http://www.daxpatterns.com/cumulative-total/
My formula:
=
CALCULATE (
[Total Net Profit and Loss],
FILTER (
ALL ( TradeLog_Table ),
TradeLog_Table[Close Date] <= MAX ( TradeLog_Table[Close Date] )
)
)
This works, but it returns more rows than desired, because my ‘TradeLog_table’ has been filtered via a lookup table and I want that filtering to be respected for the above calculation. Ie the ‘FILTER(ALL(TradeLog_Table) part naturally returns all rows but I only want rows returned that have been filtered via the lookup table filter (in my case a slicer on the lookup table). I’ve tried ALLSELECTED but this still returns all rows.
Thanks
Hi @Jtep
What happens if you remove the ALL filter?
My formula: = CALCULATE ( [Total Net Profit and Loss], FILTER (TradeLog_Table , TradeLog_Table[Close Date] <= MAX ( TradeLog_Table[Close Date] ) ) )
Thanks for quick reply! With ALL removed as per your code, unwanted rows are removed (good), but the profit and loss does not aggregate, ie is not cummulative. What is returned is the same as my '[Total Net Profit and Loss]' measure, a simple measure of SUM(TradeLog_table[Profit and Loss]). The aggregation is only working on one row, with the date expression appearing to have no effect.
Hi there
Do you perhaps have a diagram of how the filtering is working. It appears as though the filtering is happening with the "Cross Filter Direction" set to both for another table. Which can always complicate things?
Diagram attached. A normal one to many relationship established. Filtering is established by a slicer connected to my lookup table (table at the top). This selects a particular broker, then the rows on the connected table below are filtered to show only rows with the selected broker(s). Essentially I want a function like ALL that returns all 'currently filtered rows' opposed to 'all' rows'.
Hi @Jtep
I would think that if you clicked on the Broker that it would then Filter the data to the Broker selected and then still show the cumulative total?
If I attach the slicer to my data table the cummulative total works, but I need filtering controlled by the lookup table for other measures.
I'm gonna have a break. Cheers for the help.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 8 | |
| 7 | |
| 7 |
| User | Count |
|---|---|
| 36 | |
| 26 | |
| 26 | |
| 23 | |
| 22 |