1

I am working on a matrix in Power BI and I am not figuring out how to sum each column recursively until the total:

My table

And this should be the resulting matrix (as an example, rows):

My result

Some clarifications:

  • The months (columns) are dynamically generated based on the transaction month. I could filter the data to get the same data for only three months.
  • "Nombre proveedor" stands for "Vendor name".
  • I don't care about "Total" row.

These are my values:

My values

So, I think I should create a measure with DAX to replace "Accounting Balance" to sum the previous column (month) or show nothing (to avoid zeroes).

Searching on internet I found several sites to get the running totals by rows, but not by columns.

Any suggestions?

Maramal
  • 3,145
  • 9
  • 46
  • 90

1 Answers1

0

Try Something like this:

Maesure =
CALCULATE (
    [Accounting Balance],
    FILTER (
        ALL ( 'table' ),
        'table'[Transaction month] <= MAX ( 'table'[Transaction month] )
    )
)
Marco Vos
  • 2,888
  • 1
  • 9
  • 10
  • This is what I got: https://i.imgur.com/XOBlhjF.png All the rows have the same values. – Maramal Oct 17 '18 at 14:15
  • I don't think I can help you further without a sample of your data. – Marco Vos Oct 17 '18 at 14:23
  • I am displaying "the sample" of my data which is actually real and that's why I have hidden the vendors names. I have used "Vendor 1", "Vendor" and "Vendor 3" as an example in the second image. What else do you need? – Maramal Oct 17 '18 at 14:32
  • Your sample looks like a pivottable. What a table of sampledata, that i can copy to PowerBI and work with. – Marco Vos Oct 17 '18 at 14:47
  • I just solved it by creating two tables for months and vendors. ty anyway – Maramal Oct 17 '18 at 15:20