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
I've a table stock, when the product exists in my stock for a date, so it'll exist in the table as a new row
| date | product |
| 02/02/2022 | sundae |
| 05/02/2022 | sundae |
When the user select for example date filter from 01/02 till 07/02, I'd like to show
| date | product | stock |
| 01/02/2022 | sundae | 1 |
| 02/02/2022 | sundae | 1 |
| 03/02/2022 | sundae | 0 |
| 04/02/2022 | sundae | 1 |
| 05/02/2022 | sundae | 1 |
| 06/02/2022 | sundae | 0 |
| 07/02/2022 | sundae | 0 |
For example, for 04/02, I need to look for whether it exists(next day) on 05/02 and as we see that it exists, we display 1 for 04/02. For example, for 06/02, I need to look for whether it exists(next day) on 07/02 and as we see that it does not exist, we display 0 for 06/02.
For example, for 01/02, I need to look for whether it exists(next day) on 02/02 and as we see that it exists, we display 1 for 01/02.
Any idea please?
Solved! Go to Solution.
Hi @Anonymous ,
Please refer to my pbix filw to see if it helps you.
Create a column first in the first table.
edate_ = 'Table'[date]-1
Then create a measure.
Measure =
VAR _maxdate =
MAX ( 'Table'[date] ) - 1
RETURN
IF (
MAX ( 'Table (2)'[date] )
IN VALUES ( 'Table'[date] )
|| MAX ( 'Table (2)'[date] ) IN VALUES ( 'Table'[edate_] ),
1,
0
)
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please refer to my pbix filw to see if it helps you.
Create a column first in the first table.
edate_ = 'Table'[date]-1
Then create a measure.
Measure =
VAR _maxdate =
MAX ( 'Table'[date] ) - 1
RETURN
IF (
MAX ( 'Table (2)'[date] )
IN VALUES ( 'Table'[date] )
|| MAX ( 'Table (2)'[date] ) IN VALUES ( 'Table'[edate_] ),
1,
0
)
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
What about 05/02?
@tamerj1 for 05/02, I 'll check if the product exists in the table stock for this date 05/02, it exists, so I need to display 1.
Please let me know if you need more details, thank you very much
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 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |