Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Can anyone help with the following:
I have 2 tables (Item Master and Sales) and want to create a column/measure in the sales table to flag the products according to the following logic:
Based on a "Current Year" (Parameter / filter) the flag value for an Item/Product is:
- "New" - If product is sold in "Current Year" only
- "Existing" - If Product is sold in "Current Year" and in "Prior Year" (Current year -1)
- "No" - If Product was sold only in "Prior Year"
Thanks
Solved! Go to Solution.
Step1
OR
Using Variable,
Regards,
Ritesh
That make sense!
One more question I have here, is it possible apply this logic by adding additional dimention(s). In other words the flag should work for example on "Product" and "Region"?
If you say that you want to have a parameter for Current Year, then it has to be a measure out of necessity. Values in base tables cannot be changed once they've been refreshed. Also, if you want to stay sane and obtain a good model, you have to have at least 3 tables. One where you'll store your products, one which will be a Date table (Calendar) and one fact table storing the transactions. Without such a setup you'll be in trouble. But it's up to you, of course 🙂
You are absolutely right. I do have Date (Calendar) tabel which will be used to define Current year filter. I was just looking for the logic Item/Product Master and fact table.
Step1
OR
Using Variable,
Regards,
Ritesh
Thank you Ritesh - this was helpfull and very close to what Im looking for, however the switch flag value in last row in your screen shot should be "New" since "Year" and "Latest Order Year" are both "2022".
Did it help?
Please set the answer as Correct so that it can help others as well
Regards,
Ritesh
That is Nokia which was there in the last year as well(2nd row),so it should be existing ,right ?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |