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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi there ;
i need DAx formula for below issue thanks for your kind supports
i have a table as below Delivery date and Quantity , i need to create a new column which show the status as i wanted.
so the rule will be like that :
Our current month is : July 2020
İf delivery date is in the current month status will be "actual month"
if delivery dates will be before current month status will be "Previous Month "
İf delivery date will be after current month Status will be " Next Month"
Solved! Go to Solution.
Here is one way to do it with a DAX calculated column. Replace with your actual Table[Column] name that has your dates.
Status of Month =
VAR todaysdate =
TODAY ()
VAR mindate =
DATE ( YEAR ( todaysdate ), MONTH ( todaysdate ), 1 )
VAR maxdate =
EOMONTH ( TODAY (), 0 )
RETURN
SWITCH (
TRUE (),
Sales[SaleDate] < mindate, "Previous Month",
Sales[SaleDate] > maxdate, "Next Month",
"Actual Month"
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @erhan_79 ,
Create a Calculated Column
Column =
VAR _month =
MONTH ( Table[DeliveryDate] )
VAR _year =
YEAR ( Table[DeliveryDate] )
VAR _monthcurrent =
MONTH (
TODAY ()
)
VAR _yearcurrent =
YEAR (
TODAY ()
)
RETURN
SWITCH (
TRUE (),
_year < _currentyear, "Previous Month",
_year = _yearcurrent
&& _month < _monthcurrent, "Previous Month",
_year = _yearcurrent
&& _month = _monthcurrent, " Actual Month",
"Next Month"
)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Here is one way to do it with a DAX calculated column. Replace with your actual Table[Column] name that has your dates.
Status of Month =
VAR todaysdate =
TODAY ()
VAR mindate =
DATE ( YEAR ( todaysdate ), MONTH ( todaysdate ), 1 )
VAR maxdate =
EOMONTH ( TODAY (), 0 )
RETURN
SWITCH (
TRUE (),
Sales[SaleDate] < mindate, "Previous Month",
Sales[SaleDate] > maxdate, "Next Month",
"Actual Month"
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 51 | |
| 42 | |
| 25 | |
| 22 |
| User | Count |
|---|---|
| 139 | |
| 116 | |
| 54 | |
| 37 | |
| 31 |