Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hiya,
I'm struggling to work out how to formulate a column with an IF statement - i'm stuck how to express Current Month.
Thanks in advance.
Solved! Go to Solution.
Try:
Before current month =
VAR _YMToday =
YEAR ( TODAY () ) * 100
+ MONTH ( TODAY () )
VAR _YMField =
YEAR ( MAX ( 'Dates Table'[Date] ) ) * 100
+ MONTH ( MAX ( 'Dates Table'[Date] ) )
RETURN
IF ( _YMField = _YMToday, "Current month" )
Proud to be a Super User!
Paul on Linkedin.
Hi, @lcap ;
If it is less than the end of the current month:
7 Reactive Report Before Current Month? =
IF ( [Case Reported On] <= EOMONTH ( TODAY (), 0 ), "Yes", "No" )
If it is less than the start of the current month:
7 Reactive Report Before Current Month? =
IF ( [Case Reported On] <= EOMONTH ( TODAY (), -1 ), "Yes", "No" )
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
for current month use
MONTH(TODAY()) && YEAR(TODAY())
So if have a date table, the expression would be
... 'Date Table'[Month] = MONTH(TODAY()) && 'Date Table'[Year] = YEAR(TODAY())
Proud to be a Super User!
Paul on Linkedin.
Like this?
See my previous post: I edited it to be more precise....
7 Reactive Report Before Current Month? = IF([Case Reported On]<MONTH(TODAY()) && YEAR(TODAY(),"Yes","No")
You need to compare a month field with MONTH(TODAY()) and a year field with YEAR(TODAY()).
What is your [Case reported on] measure returning?
Proud to be a Super User!
Paul on Linkedin.
[Case reported on] is a date field.
Actually the code I posted will not return previous dates in previous years which are > MONTH (TODAY()).
So you can either use:
Before current month =
VAR _YMToday = YEAR(TODAY()) * 100 + MONTH(TODAY())
VAR _YMField = YEAR(MAX('Dates Table'[Date])) * 100 + MONTH(MAX('Dates Table'[Date]))
RETURN
IF(_YMField < _YMToday, "Previous")
or
Alternative =
IF (
MAX ( 'Dates Table'[Date] )
< STARTOFMONTH (
FILTER ( ALL ( 'Dates Table'[Date] ), 'Dates Table'[Date] = TODAY () )
),
"Alternative"
)
Proud to be a Super User!
Paul on Linkedin.
I already have a similar column which is working fine -
THank you so much.
Is there a simple way to use an IF statement to say wether its in the current month?
Try:
Before current month =
VAR _YMToday =
YEAR ( TODAY () ) * 100
+ MONTH ( TODAY () )
VAR _YMField =
YEAR ( MAX ( 'Dates Table'[Date] ) ) * 100
+ MONTH ( MAX ( 'Dates Table'[Date] ) )
RETURN
IF ( _YMField = _YMToday, "Current month" )
Proud to be a Super User!
Paul on Linkedin.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 42 | |
| 35 | |
| 35 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 65 | |
| 58 | |
| 28 | |
| 27 | |
| 25 |