The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I am trying to create a column in my Date table that indicates the next month of the current date. My column reads:
IsNextMonth2 =
Month(Dates[Date]) = MONTH(NOW() + 1)
It is reading True for December 2022 and False for all other months. But I want it to read True for January 2023 and False for all over months. Any suggestions? Thank you!
Solved! Go to Solution.
Hi @Benedict21
Try the code:
Best Regards!
Yolo Zhu
Hi @Benedict21 ,
You can try the following code I modified:
IsNextMonth2 =
Month(Dates[Date]) = MONTH(MONTH(NOW())+1)
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi!
Thank you but this is only capturing the next month value, not the month and year value.
Hi @Benedict21
You can try the following code:
var to_date=EOMONTH(TODAY()),1)
Best Regards,
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thank you so much for your response. Again, only showing next month; not month and year. Any suggestions?
Hi @Benedict21
Try the code:
Best Regards!
Yolo Zhu
@Benedict21 , Try like
eomonth(Date[Date],0) = eomonth(Today(),1)
Month Type = Switch( True(),
eomonth(Date[Date],0) = eomonth(Today(),0) ,"Current Month" , //This Month
eomonth(Date[Date],0) = eomonth(Today(),-1) && ,"Previous Month" , //last Month
eomonth(Date[Date],0) = eomonth(Today(),1) && ,"Next Month" , //last Month
[Month Year]
)
Hi! Thank you but I am getting a lot of incorrect syntax: Cannot find name 'Date'.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |