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.
I have a Sales Opportunities table where I am trying to create a new column that will show if the Account has a won opportunity in the past 365 days from the date the opportunity was created. I have a date table related to the create date column in the opportunity table.
The logic for this new column is something like as follows:
is_new_Opp = if client has opportunity won in the last 365 days of the date the opportunity was created, then "New", else "Existing"
Model look like this:
This is sample data that includes the column I am trying to create "is_new_Opp".
Solved! Go to Solution.
Thank you for your quick reply. I used your code and with one modification, it seems to be working. I had to add a filter to the VAR "_last" to include that the opportunity needes to be won. It now reads:
Thank you for your quick reply. I used your code and with one modification, it seems to be working. I had to add a filter to the VAR "_last" to include that the opportunity needes to be won. It now reads:
New column=
Var _last = maxx(filter(Table, [Account] = earlier([Account]) && [Opportunity_date_created] < earlier([Opportunity_date_created]) ), [Opportunity_date_created])
return
Switch(True(),
isblank(_last), "New",
datediff(_last, [Opportunity_date_created], day) >365, "New" ,
"Existing"
)
The model needs to improve, You need two copies of Prod Account. One as Fact and one dimension
and Fact should not join with prodopportunity
User | Count |
---|---|
84 | |
80 | |
70 | |
47 | |
43 |
User | Count |
---|---|
109 | |
54 | |
50 | |
40 | |
40 |