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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
M_SBS_6
Helper V
Helper V

Date Flag

Hi, 

I need to create a column that creates an output based on date today() minus 3 months. 

 

If app_date 3 months before today then "3 months" else ""

 

So in my table my column would populate "3 months" where app_date is February. 

 

Any idea how to do this please? 

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@M_SBS_6 , You can create a calculated column using below formula

 

Output Column =
IF(
'YourTable'[app_date] <= EDATE(TODAY(), -3),
"3 months",
""
)




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

Proud to be a Super User!





View solution in original post

v-xiandat-msft
Community Support
Community Support

Hi @M_SBS_6 ,

Thank you for @bhanu_gautam  answer , and I have other suggestions:

Below is my table:

vxiandatmsft_0-1715565926933.png

The following DAX might work for you:

Column = IF(DATEDIFF('Table'[Date],TODAY(),MONTH) <= 3 , "3 month",BLANK())

The final output is shown in the following figure:

vxiandatmsft_1-1715565974427.png

If this doesn't address your needs, can you please post the expected results?

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xiandat-msft
Community Support
Community Support

Hi @M_SBS_6 ,

Thank you for @bhanu_gautam  answer , and I have other suggestions:

Below is my table:

vxiandatmsft_0-1715565926933.png

The following DAX might work for you:

Column = IF(DATEDIFF('Table'[Date],TODAY(),MONTH) <= 3 , "3 month",BLANK())

The final output is shown in the following figure:

vxiandatmsft_1-1715565974427.png

If this doesn't address your needs, can you please post the expected results?

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@M_SBS_6 , You can create a calculated column using below formula

 

Output Column =
IF(
'YourTable'[app_date] <= EDATE(TODAY(), -3),
"3 months",
""
)




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

Proud to be a Super User!





Thank for the suggestion but that populates previous months with a value to, I.e Feb and all months prior to Feb 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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