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! It's time to submit your entry. Live now!
Let's say I have a load of fruit and the dates we stopped stocking them in addition to current in a Fruit Dimension table.
Apples -removed 1/15/22
Oranges - removed 3/5/22
Grapes - removed 4/11/22
Bananas - Active
Pears - Active
I currently have a filter on all removed items, but want those items to show up if the month selected is equal to or less than the date they were removed from inventory. I do not want them to show in the months following the removal date, but if I used the Removed filter, I lose everything historically. How can I write a dax or create a filter that only removes them the month AFTER the month of stock date ending?
i.e. If I select January 2022, I see my inventory of apples, but if I select February 2022, I would not see the apples.
Solved! Go to Solution.
I was able to resolve this adding a Max Date for the Month of Date Removed and then a Flag if Date Removed was >= the Max Date. I then filtered on the Flag. Thanks.
I was able to resolve this adding a Max Date for the Month of Date Removed and then a Flag if Date Removed was >= the Max Date. I then filtered on the Flag. Thanks.
Hi @Tihannah ,
I'd use a different Dates table to achieve this then create this measure to count the rows of Date Removed with which are either blank or less than or equal the currently selected period.
Is Active =
CALCULATE (
COUNTROWS ( 'Table' ),
ALL ( Dates ),
FILTER (
ALL ( 'Table'[Date Removed] ),
'Table'[Date Removed] <= MAX ( Dates[Date] )
|| 'Table'[Date Removed] = BLANK ()
)
)Please refer to this PBIX for your reference -https://drive.google.com/file/d/1lLJC0_SJMfDKYqT-q3DwFVkyTmx8aq_e/view?usp=sharing
I tried changing this =
'Table'[Date Removed] <= MAX ( Dates[Date]
to >=, but then when I select the month that they were removed, i.e. January - the apples disappear.
This appears to be operating backwards to my goal. When I select January, the items removed in March and April do not show, and when I select April, the item from January is still there? I will be showing inventory counts, and if Apples were removed in January, then I do not want them to show on the list in April.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 39 | |
| 23 | |
| 23 |
| User | Count |
|---|---|
| 144 | |
| 106 | |
| 63 | |
| 38 | |
| 31 |