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
Anonymous
Not applicable

IF function + dates

Hi guys,

 

Here's what I'm trying to do....

 

I have a table with a due date column, I want a column that returns me a date that is my "due date" + 180 days. I would call this column "provision".

 

The format of this column should be "mm/yyyy"

 

But if my "provision date" is higher than the current month, than I want that the return is "empty / blank"

 

I'm kind of newbie in power BI / power query....if you could help me, I would appreciate

 

Thanks

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Column =
IF (
    YEAR ( DATEADD ( Tab_1[DueDate].[Date], 180, DAY ) ) = YEAR ( TODAY () )
        && MONTH ( DATEADD ( Tab_1[DueDate].[Date], 180, DAY ) ) > MONTH ( TODAY () ),
    BLANK (),
    FORMAT ( DATEADD ( Tab_1[DueDate].[Date], 180, DAY ), "mm/yyyy" )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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
Anonymous
Not applicable

Hello everyone,

 

Could you help me?

 With the data set below I want to create a column that gives me the month/today as "Dta Prov 2", but that has as result all invoices that has "Dta Provisiao" = month/today and all invoices with "Dta Provisao" < month/today with "Provision" = "0"

 

NameInvoicePendingProvisionBilldateDta Provisao
ipsum531016090,00738,0031/07/200501/2006
lorem631017330,002.586,0030/06/200501/2006
alfa1114548318.625,000,0031/05/201812/2018
beta111457280,003.895,0031/05/201812/2018
omega111468864.207,000,0031/07/201802/2019
charlie111470440,006.000,0031/07/201802/2019
gamma11147697500,000,0031/08/201803/2019
delta111476984.000,000,0031/08/201803/2019

 

I was trying the combination of "IF" and "AND", but with no results, so far...

 

Thank you,

Irene

v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Column =
IF (
    YEAR ( DATEADD ( Tab_1[DueDate].[Date], 180, DAY ) ) = YEAR ( TODAY () )
        && MONTH ( DATEADD ( Tab_1[DueDate].[Date], 180, DAY ) ) > MONTH ( TODAY () ),
    BLANK (),
    FORMAT ( DATEADD ( Tab_1[DueDate].[Date], 180, DAY ), "mm/yyyy" )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @Anonymous

 

As no sample data given, i didnt test the formula but it should work.

 

IF(MONTH( Table1[Provision_Date) > MONTH( TODAY()),FORMAT(DATEADD(Table1[DueDate],180,DAY),"mm/yyyy"),BLANK())

 

Thanks
Raj

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.