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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Fiala
Helper II
Helper II

How to create a calculated columns with date - the nearest date of occurrence

Hi, is it possible to create a calculated column with the date of the next occurrence of the value according to the picture below?

Thank you
 
 

image.png

 

 

 

2 ACCEPTED SOLUTIONS
mahoneypat
Microsoft Employee
Microsoft Employee

Please try this column expression

 

Next Date =
VAR vThisDate = Table[Date]
VAR vNextDate =
    CALCULATE (
        MIN ( Table[Date] ),
        ALLEXCEPT (
            Table,
            Table[Value]
        ),
        Table[Date] > vThisDate
    )
RETURN
    vNextDate

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Fiala
Helper II
Helper II

@mahoneypat works great, thank you very much 🙂

View solution in original post

3 REPLIES 3
Fiala
Helper II
Helper II

Hellou @mahoneypat @, can you please help me again? I need almost the same. but I need to create a measure instead of calculated column. I need to find out the nearest date of occurence

I create a virtual table CD_MSISDN = value):

 

var t1 = ADDCOLUMNS(GROUPBY(Query1,Query1[value],Query1[TS_ENTERED_QUEUE]),"next contact",next_date)

looks like:
Fiala_2-1644711352614.png

 

I don´t know how to create Next contact column.

Thank you

 


Fiala
Helper II
Helper II

@mahoneypat works great, thank you very much 🙂

mahoneypat
Microsoft Employee
Microsoft Employee

Please try this column expression

 

Next Date =
VAR vThisDate = Table[Date]
VAR vNextDate =
    CALCULATE (
        MIN ( Table[Date] ),
        ALLEXCEPT (
            Table,
            Table[Value]
        ),
        Table[Date] > vThisDate
    )
RETURN
    vNextDate

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.