Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How can i create a column in power BI based on this query

select * from Y A
RIGHT JOIN X B
ON A. uniqueKEY=B. uniqueKey
where relatedtable ='maze'

 

4 REPLIES 4
Anonymous
Not applicable

You can use your query to get your table and not a column .
so what i suggest is using this query and getting it as an table and get an index with it too .

Use that index as a key to relate with your other table where you wanted this column to be in .

there are many commands like relatedtable which you can use to perform further anlaysis

Anonymous
Not applicable

could you please  be kind enough and  provide sample  code  based on what you  are recomending using  my code  i have provided here i

Anonymous
Not applicable

hello @Anonymous  , 
I dont beleive its possible to create a calculated columnn using SQL query . 

but i do beleive that you can query a table using SQL and transform it into a seperate table with index which matches indexes with the main table.

 

So connecting main table (where you need the column) and queried table can be connected throiugh relationship in model tab of power bi desktop

Anonymous
Not applicable

could you  please offer a demo code based on my sample query here?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.