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