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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
bw70316
Helper V
Helper V

List Alerts for Upcoming Milestones in Chart

I am hoping to create a list of individuals who are about to reach specific milestones within our company. For example, a month before they have reached their 5 years at the company, I would like them to be added to a list and then removed from the list once their milestone has hit. 

PErsonDate Started MilestoneDays until
Bob9/20/20155 years10
Cathy9/20/201810 years500+ days (would not show up)
Billy9/20/201010 years10 days

 

 

If this needs to be broken up into different columns for each milestone so be it, so the chart might look like:

 

Person5 YearsTen Years
Bobyesno
Billyno yes

 

And Cathy would only appear when her 10 year milestone is up. Please let me know if this is doable

1 ACCEPTED SOLUTION

Hello @bw70316

Yes, this error is because it has a blank value for the [Start Date] column, so simply adjust the formula by the IF column as below screenshot shown:

Column = 
IF([Date Started ]=BLANK(),BLANK(),

VAR __Today = TODAY()
    VAR __Start = [Date Started ]
    VAR __Table = 
        {
            ("5 Years",(DATE(YEAR(__Start)+5,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("10 Years",(DATE(YEAR(__Start)+10,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("15 Years",(DATE(YEAR(__Start)+15,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("20 Years",(DATE(YEAR(__Start)+20,MONTH(__Start),DAY(__Start))-__Today)*1.)
        }
    VAR __DaysUntil = MINX(FILTER(__Table,[Value2]>0),[Value2])
RETURN
    __DaysUntil)
Column 2 = 
IF([Date Started ]=BLANK(),BLANK(),

VAR __Today = TODAY()
    VAR __Start = [Date Started ]
    VAR __Table = 
        {
            ("5 Years",(DATE(YEAR(__Start)+5,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("10 Years",(DATE(YEAR(__Start)+10,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("15 Years",(DATE(YEAR(__Start)+15,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("20 Years",(DATE(YEAR(__Start)+20,MONTH(__Start),DAY(__Start))-__Today)*1.)
        }
    VAR __DaysUntil = MINX(FILTER(__Table,[Value2]>0),[Value2])
    VAR __Anniversary = MAXX(FILTER(__Table,[Value2]=__DaysUntil),[Value1])
RETURN
 __Anniversary)

Best regards

Lin

Community Support Team _ Lin
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
Greg_Deckler
Super User
Super User

@bw70316 - I did this in 2 columns like below. PBIX attached under sig. You want Table, Column and Column 2. @ me if this is not what you are looking for.

Column = 
    VAR __Today = TODAY()
    VAR __Start = [Date Started ]
    VAR __Table = 
        {
            ("5 Years",(DATE(YEAR(__Start)+5,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("10 Years",(DATE(YEAR(__Start)+10,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("15 Years",(DATE(YEAR(__Start)+15,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("20 Years",(DATE(YEAR(__Start)+20,MONTH(__Start),DAY(__Start))-__Today)*1.)
        }
    VAR __DaysUntil = MINX(FILTER(__Table,[Value2]>0),[Value2])
RETURN
    __DaysUntil


Column 2 = 
    VAR __Today = TODAY()
    VAR __Start = [Date Started ]
    VAR __Table = 
        {
            ("5 Years",(DATE(YEAR(__Start)+5,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("10 Years",(DATE(YEAR(__Start)+10,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("15 Years",(DATE(YEAR(__Start)+15,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("20 Years",(DATE(YEAR(__Start)+20,MONTH(__Start),DAY(__Start))-__Today)*1.)
        }
    VAR __DaysUntil = MINX(FILTER(__Table,[Value2]>0),[Value2])
    VAR __Anniversary = MAXX(FILTER(__Table,[Value2]=__DaysUntil),[Value1])
RETURN
    __Anniversary

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

I was getting a "An argument of function 'DATE' has the wrong data type or the result is too large or too small." That was the result of having blanks in my data. So I learned two things. I very much appreciate this post. Jedi Dax Master.

Hello @bw70316

Yes, this error is because it has a blank value for the [Start Date] column, so simply adjust the formula by the IF column as below screenshot shown:

Column = 
IF([Date Started ]=BLANK(),BLANK(),

VAR __Today = TODAY()
    VAR __Start = [Date Started ]
    VAR __Table = 
        {
            ("5 Years",(DATE(YEAR(__Start)+5,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("10 Years",(DATE(YEAR(__Start)+10,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("15 Years",(DATE(YEAR(__Start)+15,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("20 Years",(DATE(YEAR(__Start)+20,MONTH(__Start),DAY(__Start))-__Today)*1.)
        }
    VAR __DaysUntil = MINX(FILTER(__Table,[Value2]>0),[Value2])
RETURN
    __DaysUntil)
Column 2 = 
IF([Date Started ]=BLANK(),BLANK(),

VAR __Today = TODAY()
    VAR __Start = [Date Started ]
    VAR __Table = 
        {
            ("5 Years",(DATE(YEAR(__Start)+5,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("10 Years",(DATE(YEAR(__Start)+10,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("15 Years",(DATE(YEAR(__Start)+15,MONTH(__Start),DAY(__Start))-__Today)*1.),
            ("20 Years",(DATE(YEAR(__Start)+20,MONTH(__Start),DAY(__Start))-__Today)*1.)
        }
    VAR __DaysUntil = MINX(FILTER(__Table,[Value2]>0),[Value2])
    VAR __Anniversary = MAXX(FILTER(__Table,[Value2]=__DaysUntil),[Value1])
RETURN
 __Anniversary)

Best regards

Lin

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

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.