Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
gco
Resolver II
Resolver II

Calendar question

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

1 ACCEPTED 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.
Nathanieltoday1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

11 REPLIES 11
Nathaniel_C
Community Champion
Community Champion

Hi @gco ,

Current to today?

Nathaniel

 





Did I answer your question? Mark my post as a solution!

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

 

today.PNG

 

= Table.AddColumn(#"Changed Type1", "CurrentDate", each if Date.Month([#"Dates                 IsCurrentorPastMonth?.1"]) <= Date.Month(DateTime.LocalNow()) then "Y" else "N")

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Just tried it with 10/31 and it works.  Good point.





Did I answer your question? Mark my post as a solution!

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

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Nathaniel_C ,

 

You are a super hero!!! thank you again

Glen

Nathaniel_C
Community Champion
Community Champion

@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,





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@Nathaniel_C 

it looks like i can't on the past posts.  I just did it on this new one.  Thanks again!

@Nathaniel_C ,

 

how come i could not click on the thumbs up anymore?  i get a stop icon when i hover my mouse to it.

@Nathaniel_C 

 

nevermind i just saw your other response.  I am trying it now.

Hi Nathaniel,

 

yes, it will be for current month.  So like 10/31 would be Y

Thank you

Glen

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors