Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I have an inventory table with 2 columns, product_id and date.
Each product_id only has a date for the days we had it in stock.
Im trying to to count how many days we had the product in stock for the last 30 days before the date in the column, and i want this for all the past dates, ie check fro mthat date 30 days back how many entries it has.
Solved! Go to Solution.
Column =
VAR _current_product = 'Table'[product_id]
VAR _current_date = 'Table'[date]
VAR _result =
COUNTROWS(
FILTER(
'Table'
,'Table'[product_id] = _current_product
&& 'Table'[date] >= _current_date - 29
&& 'Table'[date] <= _current_date
)
)
RETURN
_result
Column =
VAR _current_product = 'Table'[product_id]
VAR _current_date = 'Table'[date]
VAR _result =
COUNTROWS(
FILTER(
'Table'
,'Table'[product_id] = _current_product
&& 'Table'[date] >= _current_date - 29
&& 'Table'[date] <= _current_date
)
)
RETURN
_result
Flawless solution, thank you so much!
User | Count |
---|---|
88 | |
74 | |
69 | |
65 | |
58 |
User | Count |
---|---|
104 | |
94 | |
76 | |
62 | |
59 |