Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All,
I have tried to figure out this problem but have no success, hope someone can lend me their expertise in this problem. Thanks!
The problem-
If action "Sign Up" and (phone or email) happen in the same day, then show the flag for that member as 1, otherwise 0.
Data -
Client | Date | Action |
A | 1/01/2024 | Phone |
A | 1/01/2024 | |
A | 1/01/2024 | Sign up |
A | 2/01/2024 | Phone |
B | 1/01/2024 | Sign up |
B | 2/01/2024 | Phone |
C | 3/01/2024 | Phone |
C | 3/01/2024 | |
C | 4/01/2024 | Sign Up |
Expected result -
Result | have sign up and (email or phone) in same day |
A | 1 |
B | 0 |
C | 0 |
A has sign up and phone/email on same day.
B and C don't have the sign up in the same day as phone/email.
Thank you again in advance for all the assistance.
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
It is for creating a measure.
expected result measure: =
VAR _t =
FILTER ( Data, Data[Action] = "Sign up" )
VAR _signupdatelist =
SUMMARIZE ( FILTER ( Data, Data[Action] = "Sign up" ), Data[Date] )
VAR _condition =
COUNTROWS (
FILTER (
Data,
Data[Date]
IN _signupdatelist
&& Data[Action] IN { "Phone", "Email" }
)
) > 0
RETURN
IF ( _condition && HASONEVALUE ( Client[Client] ), 1, 0 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
It is for creating a measure.
expected result measure: =
VAR _t =
FILTER ( Data, Data[Action] = "Sign up" )
VAR _signupdatelist =
SUMMARIZE ( FILTER ( Data, Data[Action] = "Sign up" ), Data[Date] )
VAR _condition =
COUNTROWS (
FILTER (
Data,
Data[Date]
IN _signupdatelist
&& Data[Action] IN { "Phone", "Email" }
)
) > 0
RETURN
IF ( _condition && HASONEVALUE ( Client[Client] ), 1, 0 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Thanks @Jihwan_Kim !!!!!
You are a magician and life saver! Thank you so much. This works wonderfully.
User | Count |
---|---|
18 | |
18 | |
14 | |
14 | |
13 |
User | Count |
---|---|
17 | |
14 | |
11 | |
10 | |
8 |