Forum Discussion
Inventuory filling dates
I've a table Propre for stock like the following picture
Please find here the report .pbix https://1drv.ms/u/s!Amd7BXzYs7AVlXPjuP0CfblYyc5K?e=aZ1mab
For example, for epc =4767426B3030340000000007, I need to check the maximum date existing in the table propore. The maximum date = 15/05/2022
Then, when the user selects date range between 01/02/2022 till 03/07/2022,
So I need to display nb=1 for all dates less than the maximum dates, so for the example for all dates between 01/02/2022 till 15/05/2022, I should dispaly 1. And for all dates between 16/05/2022 till 03/07/2022, I should dispaly 0.
I create a new table Inventaire but it returns wrong resulats
Inventaire =
GENERATE (
filter(Propre, Propre[Statut]="PROPRE"),
GENERATESERIES (
CALCULATE ( DISTINCT ( Propre[Date] ) ),
VAR Current_ =
CALCULATE ( DISTINCT ( Propre[Date] ) )
VAR Next_ =
CALCULATE (
MIN ( Propre[Date] ),
Propre[Date] > Current_,
ALL ( Propre[Nb] )
)
RETURN
IF ( NOT ISBLANK ( Next_ ), Next_ - 1, Current_ )
)
)
How to correct it to get the expected results?
- Anonymous4 years ago
Hi Anonymous ,
1. Sorry I could not get your pbix file successfully:
So I built a simply data sample for test:
2. Since you want to dynamically set the Nb value based on Date selections, you need to create a Date table for slicer firstly and then create Nb measure not column.
Dates for slicer = CALENDAR(MIN('Propre'[Date]),MAX('Propre'[Date]))3. I have a question about the maximum date—— In my data sample, the max Date for A is 2022/5/15 , for C is 2022/6/4, so the the maximum date is 2022/6/4 ? Or each EPCs has its own maximum date?
Please provide me with more details about your table and your expected output or share me with your pbix file after removing sensitive data.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Any help please
- AnonymousNot applicable
Hi Anonymous ,
1. Sorry I could not get your pbix file successfully:
So I built a simply data sample for test:
2. Since you want to dynamically set the Nb value based on Date selections, you need to create a Date table for slicer firstly and then create Nb measure not column.
Dates for slicer = CALENDAR(MIN('Propre'[Date]),MAX('Propre'[Date]))3. I have a question about the maximum date—— In my data sample, the max Date for A is 2022/5/15 , for C is 2022/6/4, so the the maximum date is 2022/6/4 ? Or each EPCs has its own maximum date?
Please provide me with more details about your table and your expected output or share me with your pbix file after removing sensitive data.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.