Forum Discussion

ScripTeapot_'s avatar
ScripTeapot_
Frequent Visitor
3 years ago
Solved

I need help to create a new table from another one

I don't know if this is tricky or is just me, but here goes nothing.

 

I have one table with a group of columns that are months and another group of columns that are also months, each group have a different context in its values; one group is a planified budget, the other group is the real disbursement. Something like this:

idtitlejan_planified_amountfeb_planified_amount(…)jan_real_amountfeb_real_amount(...)
1example_1$500,00$0,00(…)$0,00$500,00(…)

 

So I tried creating two new tables, one for each group and unpivot the columns, keeping the ids, the months and the amount. Then I create a relation many to many and create a new table with only ids, but when I tried putting the values in a chart it does not work.
So I need another way to relate these tables or create only one table with both values like this:

idtitlemonthplanified amountreal amount
1example_1jan$500,00$0,00
1example_1feb$0,00$500,00
1example_1mar$1.000,00$1.000,00
1example_1apr$0,00$0,00
1example_1may$0,00$0,00
1example_1jun$0,00$0,00
1example_1jul$0,00$0,00
1example_1aug$0,00$0,00
1example_1sep$1.000,00$0,00
1example_1oct$0,00$0,00
1example_1nov$0,00$0,00
1example_1dic$1.000,00$2.000,00

Because I need a chart like this:

Been the bars the planified amount and the line the real amount.

 

I don't know if this is the best way to achieve this but is the only thing I cant think of. I need a little help.

2 Replies

  • some_bih's avatar
    some_bih
    Icon for Community Champion rankCommunity Champion

    Hi ScripTeapot_ , budgeting in PowerBI is possible but you should be aware of details of your model. Example, in your budget there could be product which there are not in actuals ... Many to many relationship could create ambigious results so be careful.

    If not already, please check link by SQLBI for this topic

    https://www.sqlbi.com/tv/budgeting-with-power-bi/  and related pattern (paid). I did not use paid but I used other content and it is great https://www.sqlbi.com/p/dax-patterns-budget/ 

    Personally, this is not easy to implement as requires a lot of modeling.

    • ScripTeapot_'s avatar
      ScripTeapot_
      Frequent Visitor

      thank you for all the help! I will study this.