Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
To get Previous month and current month as a new field.
Hi Guyz
I'm trying to create a custom column having "Current month" and "Previous month" as a tag based on the system date.
For example:- ( my system date is 27-06-2020 )
Category | Date | Amount |
A | 01-04-2020 | 100 |
B | 01-04-2020 | 100 |
C | 01-05-2020 | 100 |
D | 02-05-2020 | 100 |
E | 03-05-2020 | 100 |
F | 04-05-2020 | 100 |
G | 01-06-2020 | 100 |
H | 02-06-2020 | 100 |
I | 03-06-2020 | 100 |
J | 04-06-2020 | 100 |
Expected result::-
Category | Date | Amount | Flag |
C | 01-05-2020 | 100 | Previous month |
D | 02-05-2020 | 100 | Previous month |
E | 03-05-2020 | 100 | Previous month |
F | 04-05-2020 | 100 | Previous month |
G | 01-06-2020 | 100 | Current month |
H | 02-06-2020 | 100 | Current month |
I | 03-06-2020 | 100 | Current month |
J | 04-06-2020 | 100 | Current month |
Solved! Go to Solution.
@Anonymous try this
Tag =
IF ( EOMONTH ( Table[Date], 0 ) = EOMONTH ( TODAY(), -1 ), "Previous Month",
IF ( EOMONTH ( Table[Date], 0 ) = EOMONTH ( TODAY(), 0 ), "Current Month",
""
) )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @Anonymous ,
Is this problem solved?
If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If not, please let me know.
Best Regards,
Icey
@Anonymous try this
Tag =
IF ( Table[Date] < EOMONTH ( TODAY(), -1 ) + 1, "Previous Month",
IF ( EOMONTH ( Table[Date], 0 ) = EOMONTH ( TODAY(), 0 ), "Current Month",
"Next Month"
) )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Buddy, Thanks a ton !
I implemented the expression. However, April month is getting tagged as the previous month ( ideally it should not ).
Technically, April as Not consider ; May as Previous month and June as Current month
Please advise.
@Anonymous try this
Tag =
IF ( EOMONTH ( Table[Date], 0 ) = EOMONTH ( TODAY(), -1 ), "Previous Month",
IF ( EOMONTH ( Table[Date], 0 ) = EOMONTH ( TODAY(), 0 ), "Current Month",
""
) )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |