I had created a measure to populate the matrix visual. It uses
=SWITCH()to return the YTD amount for the revenue and expense row headers and returns a subtotal for the net income header.
To finish building the income statement, I needed to add two more line items: retained income from the beginning and end of the year. I had already created the categories in the Power Query Editor, so I had to update the DAX statement to return logic for these lines.
Read on to see how to add these.