Forum Discussion

aishak12's avatar
aishak12
Helper IV
5 years ago
Solved

Create new column based on relationship in another SQL View

Hello,

 

I have two SQL views one for Actual and the other is Budgeting data. These views both contain a column Period with data from 2020 01 - 2021 12.

 

In the SQL View (Actual) I have a column for MonthPassed that is 1 or 0 based on the Period. I want to add this column to the Budgeting view in PowerBI. 

 

For example if Period (202001) = MonthPassed (1) it should have the same relationship in the Budgeting view. 

 

Actual: 

 

 

Budgeting

 

 

Is this possible to add in PowerBI if so how should I approach this for the relationship to reflect the same values. 

 

 

Thank you

  • Hi aishak12 ,

     

    I think it is possible. I did the following test and created two tables. The Period and Monthpass fields are from different tables. In powerbi query, I only need to add the same index to the two tables respectively, and then merge into one table according to the index, and finally get the budget table successfully.

    get Budgeting result

     


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

    Best Regards,
    Henry

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

22 Replies