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.
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
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.