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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
juhoneyighot
Helper III
Helper III

Conditional date formula dax

Hello!

I have this data. With Mac Trans Date Column, I want to create a measure that is this Transdate is 1 and 1/2 yr older than a current date then " No Need to Request" elsa "".

juhoneyighot_0-1733409970012.png

Thank you so much!

1 ACCEPTED SOLUTION

Ok, you can intergrate calculate and filter function as follows:

SubAgreeCertRequest =
VAR CutoffDate = TODAY() - 548
RETURN
IF (
CALCULATE(
MAX(_Facts[TransDate]),
_Facts[GLName] = "Bank Account - USD",
_Facts[FH_CurrentYN] = "Yes",
_Facts[FH_Type] = "28 Legacy AS Transactions"
) <= CutoffDate,
"No Need to Request",
""
)

 

 

Try the above. 





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

Proud to be a Super User!





View solution in original post

4 REPLIES 4
rajendraongole1
Super User
Super User

Hi @juhoneyighot - you can use the following formula

Status Measure =
VAR CutoffDate = TODAY() - 548 -- Approx. 1.5 years in days (365.25 * 1.5)
RETURN
IF(
MAX('YourTable'[Mac Trans Date]) <= CutoffDate,
"No Need to Request",
""
)

 

use the  above measure to your Power BI report.Place it in a table visual or any context where you want to see the result for each record.Ensure the Mac Trans Date column is properly formatted as a date column.





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

Proud to be a Super User!





@rajendraongole1 
This is the correct Formula SubAgreeCertRequest =
VAR CutoffDate = TODAY() - 548
RETURN
IF (
MAX(_Facts[TransDate]) <= CutoffDate,
"No Need to Request",
""
)

But I have to Filter the following from _Facts table
_Facts[GLName] = "Bank Account - USD",
_Facts[FH_CurrentYN]="Yes",
_Facts[FH_Type]="28 Legacy AS Transactions"

 

how should I integrate this in the formula?

Ok, you can intergrate calculate and filter function as follows:

SubAgreeCertRequest =
VAR CutoffDate = TODAY() - 548
RETURN
IF (
CALCULATE(
MAX(_Facts[TransDate]),
_Facts[GLName] = "Bank Account - USD",
_Facts[FH_CurrentYN] = "Yes",
_Facts[FH_Type] = "28 Legacy AS Transactions"
) <= CutoffDate,
"No Need to Request",
""
)

 

 

Try the above. 





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

Proud to be a Super User!





@rajendraongole1 

juhoneyighot_0-1733413517924.png

Bumped into an error. That date is a measure by the way.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!