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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kousar99
Helper I
Helper I

how to use Joins and Subquries in Power Bi

Hi, 

Since I am using SQL queries and whatever the output is coming from queries same thing showing in form of charts in power bi.

Since I'm new to power bi and Dax, I need help and suggestions for how to use subqueries used in SQL ( As per my thinking filtering is done) and joins in power bi and Dax.
Looking for your kind response.

 

Thanks & Regards,

 Heena Kousar

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @kousar99,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@kousar99 , Please share a problem, while we can create a table and pass it as a filter. But in DAX we do it DAX way, maybe a better solution is available

 

Check

Dax vs SQL -https://www.youtube.com/watch?v=WlvQ_SGy4iA&list=PLPaNVDMhUXGZNyKU0PgG2g3P0c6CPjMnj

 

example

measure =
var _tab = summarize(filter(Table,{empresa_id]=4),[tenant_id])
return
calculate(sum(Table[Value]), filter(Table,Table[tenant_id] in _tab))

 

 

measure =
var _tab = summarize(filter(A, [date]= date(2020,11,05) && [State] ="Step2" && [Status] = "Status" ), A[FileName])
return
calculate(countrows(A) , filter(A , [FileName] in _tab && [State] ="Step2" && [Status] = "Status" ))

 

 

measure =
var _tab = summarize(filter(all(users), users[usermail] in values(users[usermail]) || users[businessrecipient] in values(users[usermail])),users[businessunit])
return
calculate(countrows(masterlist), filter(masterlist, masterlist[businessunit] in _tab))

 

refer

https://docs.microsoft.com/en-us/dax/treatas-function

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors