This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi all!
I am trying to create a date bucket using DAX to filter date ranges from last 3 months, last 6 months, and previous year.
This is the code that I have:
Solved! Go to Solution.
TODAY() is 2023-03-02
MONTH(TODAY() -3) means TODAY()-3, which is 2023-02-28 and a month from this is 2.
MONTH(TODAY() -6) means TODAY()-6, which is 2023-02-25 and a month from this is also 2.
YEAR(TODAY() -1) means TODAY()-1, which is 2023-03-01 and a year from this is 2023.
'Vendor Inventory'[Date Received] >= TODAY() means "is my date received is equal or greater than today"
So you are looking for todays() and futures dates that is also lower than a some NUMBER (not date). That's why all your rows are in Other bucket. There is no chanse that something will match to this condition. 🙂
Proud to be a Super User!
TODAY() is 2023-03-02
MONTH(TODAY() -3) means TODAY()-3, which is 2023-02-28 and a month from this is 2.
MONTH(TODAY() -6) means TODAY()-6, which is 2023-02-25 and a month from this is also 2.
YEAR(TODAY() -1) means TODAY()-1, which is 2023-03-01 and a year from this is 2023.
'Vendor Inventory'[Date Received] >= TODAY() means "is my date received is equal or greater than today"
So you are looking for todays() and futures dates that is also lower than a some NUMBER (not date). That's why all your rows are in Other bucket. There is no chanse that something will match to this condition. 🙂
Proud to be a Super User!
I figured it out with this:
It won't work. You will get insteed:
Last 3 months
Months between 4 and 6
and months between 7 and 12
This is how your code works. 🙂
Proud to be a Super User!
I realized that minutes after I got it working, I think I need a measure
You don't need "'Vendor Inventory'[Date Received] >= TODAY() " logic. Tha's contradicting the other logic you have in the formula.
In each IF statement, only keep 'Vendor Inventory'[Date Received] < MONTH(TODAY()) -3 part but change it to something like MONTH( 'Vendor Inventory'[Date Received] ) > MONTH(TODAY()) -3 && YEAR('Vendor Inventory'[Date Received]) = YEAR(TODAY())
And for last year logic, you can do
YEAR('Vendor Inventory'[Date Received]) = YEAR(TODAY()) -1
Thank you so much for your help but I'm afraid this isn't working. I'm looking to create date buckets where
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 37 | |
| 29 | |
| 28 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 66 | |
| 36 | |
| 29 | |
| 25 | |
| 24 |