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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply

Custom columns that return projects that are >=30 days and <= 90 days of In Service Date

I have a table that contains (among other columns) the following columns: Project Name, PISD, and ICFISD

 

The ask is to identify projects where the ICFISD is between 30 days of the PISD and a separate list of projects where the ICFISD is between 90 days of the PISD - we will always have a PISD, we may not always have the ICFISD. 

 

Project NamePISDICFISD>=30<=90
Allen 112/31/202510/31/2025  
Allen 2 (GRR)10/31/20279/3/2027  
Allen 310/1/2028   
Anclote12/31/2029   
Asheville   (fmr. Lake Julian)3/31/20268/15/2025  
Atkinson3/1/2029   
Avon Park12/31/2029   
Aynor12/31/2026   
Camp Lejeune 24/30/2027   
Cliffside7/1/2029   
Coleridge9/30/20273/31/2031  
Craggy3/31/202612/1/2025  
Dan River1/1/2029   
Elm City9/30/20256/30/2025  
Eno6/30/2030   
Frieden5/31/2025   
Half Moon SPS Retrofit12/31/2028   
HF Lee 14/1/20286/2/2028  
HF Lee 210/1/20284/2/2029  
Jumper Creek SPS Retrofit12/31/2028   
Knightdale (Wake)9/30/20255/30/2025  
Longtown2/1/20263/31/2026  
Maiden Creek6/30/2027   
Monroe12/31/20241/15/2025  
Nebo3/27/20263/31/2026  
New Hill12/31/20266/30/2026  
Oriental3/1/2029   
Powerline3/1/20276/1/2029  
Rattler SPS Retrofit12/31/2028   
Riverbend10/31/20275/21/2027  
Riverside9/25/202512/31/2022  
Sadler1/1/2029   
Spring Hope4/1/2029   
Suwannee2/28/202511/30/2024  
Warrenton12/1/2029   
Warsaw10/31/20247/19/2024  
Warsaw 212/31/2025   
Weatherspoon4/1/2029   
Wilkes12/31/202710/1/2027  
Williamsboro6/30/20273/31/2031  

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @rosamhernandez1 

You can create custom column in PowerQuery, and try the following expression:

vyohuamsft_0-1730083170568.png

= if [ICFISD] <> null and Duration.Days([PISD] - [ICFISD]) >= 30 then "Yes" else "No"

vyohuamsft_1-1730083200005.png

 

= if [ICFISD] <> null and Duration.Days([PISD] - [ICFISD]) <= 90 then "Yes" else "No"

vyohuamsft_2-1730083254636.png

 

Here is my preview:

vyohuamsft_3-1730083283050.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

5 REPLIES 5
Kedar_Pande
Super User
Super User

@rosamhernandez1 

Create a calculated column to check if ICFISD is within 30 days before PISD:

30 Days = 
IF(
NOT(ISBLANK([ICFISD])) &&
[PISD] - [ICFISD] >= 0 &&
[PISD] - [ICFISD] <= 30,
"Yes",
BLANK()
)

Create another calculated column to check if ICFISD is within 90 days before PISD:

90 Days = 
IF(
NOT(ISBLANK([ICFISD])) &&
[PISD] - [ICFISD] >= 0 &&
[PISD] - [ICFISD] <= 90,
"Yes",
BLANK()
)

💌If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Sahir_Maharaj
Super User
Super User

Hello @rosamhernandez1,

 

You need two custom columns to evaluate the conditions. Can you please try the following:

Is_>=30_Days = 
IF(
    NOT(ISBLANK([ICFISD])) && 
    DATEDIFF([PISD], [ICFISD], DAY) >= 30, 
    "Yes", 
    "No"
)
Is_<=90_Days = 
IF(
    NOT(ISBLANK([ICFISD])) && 
    DATEDIFF([PISD], [ICFISD], DAY) <= 90, 
    "Yes", 
    "No"
)

 

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

@Sahir_Maharaj, thank you. I am a relatively new user to Power Bi, learning on the job, and I am attempting to add custom columns using Power Query; is this for use in that space? I am receiving an error message at the IF. 

 

rosamhernandez1_0-1729888902344.png

 

Anonymous
Not applicable

Hi, @rosamhernandez1 

You can create custom column in PowerQuery, and try the following expression:

vyohuamsft_0-1730083170568.png

= if [ICFISD] <> null and Duration.Days([PISD] - [ICFISD]) >= 30 then "Yes" else "No"

vyohuamsft_1-1730083200005.png

 

= if [ICFISD] <> null and Duration.Days([PISD] - [ICFISD]) <= 90 then "Yes" else "No"

vyohuamsft_2-1730083254636.png

 

Here is my preview:

vyohuamsft_3-1730083283050.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

@Anonymous, thank you! this works perfectly! 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors