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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Employee
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
Employee
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors