So I have a Table/Query set up, and I need to add some information to that table, with a new column.
I can't calculate the result with DAX, so I created a function in my SQL Server.
Visualized with simple tables:
Table Bookings: (Role Booker is the one who booked the room, role Guest is someone joining him)
[Booking_ID] [Person_ID] [Name] [Hotel_ID] [(New Column)County] [Role]
1234 1 Andrew 1 County1 Guest
1234 2 Mark 1 County1 Booker
Now, County is stored on Person, but only on the one who has the role of "Booker" fills out their county.
So person with ID = 1 does not have a county. But I can use "Booking_ID" to get the county.
So, is there a way for me to say that the value of X column, is the result of a function with a single parameter from the samle table?
Sorry if this is unclear, let me know if you have any questions.
The thing is, there is a bizzarre relationship between the tables.