Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi, I am stuck
here is my issue
i have a table1 of items with 2 columns :
item, date-ref
There is no duplicate in that table1
and a table2 of sale transactions
tr_id, date-sale, item, qty
In this table2, only tr_id is unique
Tables are linked with item field
I want to create a measure1 counting for each date-sale the number of items in table2 where date-sale>=date-ref
ultimately, I will produce a table like this
date-sale, item, measure1
any idea ?
thanks for your help
regards
Marc
Solved! Go to Solution.
Hi marcp
I am a bit new to this, and there is probably a more straight-forward way. I suggest the following steps:
Make a query from table 2
merge table 1 based on item
expand columns to include the ref date
Add a column that says "Keep" if the date-sale is >= ref date or "Drop" otherwise
Filter the new column to keep the "Keep" values
Group by date-sale and item, making a column called measure1 that counts rows
I think that should get you where you want to be.
kingcondie
Hi,
Share your datasets and show the expected result.
back to work
i'll try to implement it
Hi marcp
I am a bit new to this, and there is probably a more straight-forward way. I suggest the following steps:
Make a query from table 2
merge table 1 based on item
expand columns to include the ref date
Add a column that says "Keep" if the date-sale is >= ref date or "Drop" otherwise
Filter the new column to keep the "Keep" values
Group by date-sale and item, making a column called measure1 that counts rows
I think that should get you where you want to be.
kingcondie
Hi
Thank you very much Kingcondie !
It works fine
I can't share proprietary datas but your method solved my issue 🙂
Regards
Marc
Hi Kingcondie
Thank you for your answers. This method makes sense. I’ll try it on Monday.
I wonder if a magic Dax formula can do it too.
Regards
Marc
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 124 | |
| 101 | |
| 67 | |
| 49 |