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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there,
I have a date column that shows dates for current year (01/01/2019-12/31/2019). And i would like to create a calculated column called "IsCurrentorPastMonth?" and will have a value of Y or N. Would anyone know what the calculated column would look like?
Sample:
Dates IsCurrentorPastMonth?
01/02/2019 Y
07/02/2019 Y
10/01/2019 Y
11/03/2019 N
12/02/2019 N
Your help is greatly appreciated!
Thank you
Glen
Solved! Go to Solution.
Hi @gco ,
Here is the input form for the conditional column.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Hi @gco ,
Current to today?
Nathaniel
Proud to be a Super User!
Hi @gco
Doing this in Power Query is more efficient. Matches your post.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
= Table.AddColumn(#"Changed Type1", "CurrentDate", each if Date.Month([#"Dates IsCurrentorPastMonth?.1"]) <= Date.Month(DateTime.LocalNow()) then "Y" else "N")
Proud to be a Super User!
Just tried it with 10/31 and it works. Good point.
Proud to be a Super User!
hey @Nathaniel_C ,
That is pretty quick. I am pretty noob. can you please tell me how to do this? i am used to right-clicking an existing table and then entering the DAX.
Hi @gco ,
Here is the input form for the conditional column.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
@gco ,
You are welcome! @MattAllington book Supercharge Power BI is a great place to start. And remember, I get paid by Kudos...the thumbs up.
Cheers,
Proud to be a Super User!
it looks like i can't on the past posts. I just did it on this new one. Thanks again!
how come i could not click on the thumbs up anymore? i get a stop icon when i hover my mouse to it.
Hi Nathaniel,
yes, it will be for current month. So like 10/31 would be Y
Thank you
Glen
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |