Take a table name from a cell in table dashboard

How about colleagues.

I have a dashboard table, there I have a Month column and I have configured it as Enum with buttons and month values = January, February, March, April, etc.

I have tables of cash flow records by month, classified mainly by expenses and income.

What I want to do is that from the dashboard I can calculate the income for the month that is chosen in the month column.

Currently I have this formula SUM (SELECT (January[Amount], [Type] = Income)) that calculates the income for the month of January without problems, but I have to do it manually, that is, to see the income February I must change the formula so that it now says February instead of January.

I want the formula to take the month from the month column in the dashboard.

I appreciate your help.

Like this:

SWITCH(
  [month],
  "January", SUM(SELECT(January[Amount], [Type] = Income)),
  "February", SUM(SELECT(February[Amount], [Type] = Income)),
  ...,
  "December", SUM(SELECT(December[Amount], [Type] = Income)),
  0
)
1 Like

@Steve you are a Genius!! Thanks so much my friend. It has worked perfectly.

1 Like