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! Request now

Reply
efhache
Frequent Visitor

Add columns with the true/false value based on a comparaison from other one source

Hi,

I've two sources "querry1" and "querry2".
 Querry1  contains a lot of columns but three of them are  "action_1_byuserID", "action_2_byuserID"  and "action_3_byuserID".
Querry 2 contain a column  "userID".

I would like to add a new column when the result is true when (querry1[action_1_byuserID] = querry2[UserId]) AND (querry1[action_2_byuserID] = querry2[UserId]) AND (querry1[action_3_byuserID] = querry2[UserId]).

Sure I could use three merge querry to solve it, but there is may be a better way, no?

 

Some one can help me ?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@efhache ,


DAX
new column in query 1 =
var _cnt = countx(Filter(querry2, querry1[action_1_byuserID] = querry2[UserId] && querry1[action_2_byuserID] = querry2[UserId] && querry1[action_3_byuserID] = querry2[UserId]), querry2[UserId])
return
if(isblank(_cnt), false(), True())

 

 

DAX
new column in query 2 =
var _cnt = countx(Filter(querry1, querry1[action_1_byuserID] = querry2[UserId] && querry1[action_2_byuserID] = querry2[UserId] && querry1[action_3_byuserID] = querry2[UserId]), querry1[action_3_byuserID] )
return
if(isblank(_cnt), false(), True())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@efhache ,


DAX
new column in query 1 =
var _cnt = countx(Filter(querry2, querry1[action_1_byuserID] = querry2[UserId] && querry1[action_2_byuserID] = querry2[UserId] && querry1[action_3_byuserID] = querry2[UserId]), querry2[UserId])
return
if(isblank(_cnt), false(), True())

 

 

DAX
new column in query 2 =
var _cnt = countx(Filter(querry1, querry1[action_1_byuserID] = querry2[UserId] && querry1[action_2_byuserID] = querry2[UserId] && querry1[action_3_byuserID] = querry2[UserId]), querry1[action_3_byuserID] )
return
if(isblank(_cnt), false(), True())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks a lot for the help

Indeed via DAX... it's analysis.  Thanks, it helps, just change AND by OR  and works for me 

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.

Top Solution Authors
Top Kudoed Authors