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