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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.