- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

stock calculation based on the next day
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Anonymous
What about 05/02?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
02-01-2024 12:47 AM | |||
05-28-2024 04:35 AM | |||
09-02-2024 11:54 PM | |||
07-09-2024 10:57 AM | |||
09-13-2024 10:07 AM |
User | Count |
---|---|
131 | |
102 | |
85 | |
53 | |
46 |