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.
Hey team, I feel the answer to my question does sit somewhere within this forum but my capability of understandig DAX limits my ability to combine several solutions into one. So here goes:
I have some logic setup in an excel sheet that I'm trying to replicate into PBI but I'm struggling. Right now I have two tables that I'm trying to do a lookup between, initially I used "lookupvalue" but that doesn't like duplicate values. Now I'm using "firstnonblank" where I copied some formula from a forum that seems to work but I don't actually understand, so if you know of a solution please treat me like I'm a 5 year old because I'd prefer understanding the code rather than simply replicate.
Table 1: lead data
Basically individual records with contact details and a creation date. Email address is what I do to do my "vlookup" but creation date is also important as I want the most recent record in case of the email address occurring more than once.
Table 2: Product purchases
These are date stamped purchase records against email addresses.
What I'm trying to achieve is a column in my lead data that gives me any desired column from the product purchases table for an email match for both the most recent lead and the most recent purchase. In this case I'm after product category for example.
This is admittedly step 1 in a bigger string of verification so bonus points if it's possible to create 1 column for the penultimate result I'm after:
I need a count of matches where the purchase date occurred AFTER the creation date as I'm trying to prove the indirect effect of some of our marketing campaigns with leads who don't DIRECTLY engage with us through submitting leads, do end up purchasing indirectly.
I'll need several columns of table 2 such as category, sub category, and the actual days between lead creation and purchase so ideally looking for a vlookup esque function that can be applied to any column of choosing.
If anyone can help me out with this that'd be greatly appreciated.
Table 1
Creation date | Desired output | |
john@gmail.com | 2020 | A |
tim@gmail.com | 2019 | B |
frank@gmail.com | 2019 | null |
john@gmail.com | 2019 | null |
Table 2
Purchase date | Product category | |
john@gmail.com | 2020 | A |
tim@gmail.com | 2019 | B |
john@gmail.com | 2015 | C |
By using FIRSTNONBLANK() you essentially turn this into a vlookup. In this scenario if you don't use it DAS essentially returns a list and doesn't know how to handle it resulting in the error. When a vlookup is used in excel it basically find the corresponding matching value and stops. When you use firstnonblank you are kinda telling the formula to stop searching once it finds that first value that isn't blank. Disclaimer that isn't true technically speaking but in practice it is. Does that make sense?
To get the next step you will need to put a filter in your lookup formula that adds that condition. If you send your current formula I can help you configure it to your ask.
Hi, thanks so much for your explanation. I've been playing around a bit and trying to verify and the formula does appear to work the way it's intended. However, I'm running into a bit of a duplication issue. The current formula is: (pardon the formatting)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
39 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |