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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Fill with the value of the previous cell in DAX

Good afternoon.

I need to get the expected result in the Nevento column with DAX

JECJ_0-1632914840391.png

The expected result is still the start date/time of each event.

The "whim of doing it with Dax is because of the volume of dtos (1,700,000 and going up).

I have tried to refer to the colu

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @JECJ ,

 

Try to create a column like so:

Column =
VAR Most_Recent_Date_Without_Event =
    MAXX (
        FILTER (
            'Table',
            'Table'[Date] < EARLIER ( 'Table'[Date] )
                && 'Table'[Event] = BLANK ()
                && EARLIER ( 'Table'[Event] ) <> BLANK ()
        ),
        [Date]
    )
RETURN
    MINX (
        FILTER (
            'Table',
            'Table'[Date] > Most_Recent_Date_Without_Event
                && Most_Recent_Date_Without_Event <> BLANK ()
        ),
        [Date]
    )

Icey_0-1633402458801.png

 

 

Best Regards,

Icey

 

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
Icey
Community Support
Community Support

Hi @JECJ ,

 

Try to create a column like so:

Column =
VAR Most_Recent_Date_Without_Event =
    MAXX (
        FILTER (
            'Table',
            'Table'[Date] < EARLIER ( 'Table'[Date] )
                && 'Table'[Event] = BLANK ()
                && EARLIER ( 'Table'[Event] ) <> BLANK ()
        ),
        [Date]
    )
RETURN
    MINX (
        FILTER (
            'Table',
            'Table'[Date] > Most_Recent_Date_Without_Event
                && Most_Recent_Date_Without_Event <> BLANK ()
        ),
        [Date]
    )

Icey_0-1633402458801.png

 

 

Best Regards,

Icey

 

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

Perrrrrrfectoooo

Thanks a lot. Works.

Eres el fmou (f?" % master of universe)

A hug from Malaga

Syndicate_Admin
Administrator
Administrator

Can you include data in table format? (not an image)

Singaravelu_R
Resolver III
Resolver III

Hi, 

 

I am not sure what you are need exactly, based on excel you have show I have given result like below, if you need anyother things plesase reply,

 

Add calculated column 

 

Nevento = if('Table'[Evento]=1,'Table'[Date].[Date])
 
Singaravelu_R_0-1632916289146.png

 

First of all thank you for the answer @Syndicate_Admin

What I intend is that you "drag" the first date time while the event is 1 consecutively. The moment you go to zero and go back to one, take back the first date/time of the next event.

Greetings

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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