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

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.

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
Super User
Super User

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

@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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors