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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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())

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())

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.