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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
SandraGDS
New Member

CurrentIndex -1

Hi 
 
I need help, i want to say "if the ProcessNumber currentIndex -1 does'nt exist then -1 again untill found"
 
Timestamp =
VAR CurrentCase = 'Export Worksheet'[Order]
VAR CurrentIndex = 'Export Worksheet'[ProcessNumber]
VAR PreviousIndex = CurrentIndex - 1
RETURN
    CALCULATE (
        SELECTEDVALUE ( 'Export Worksheet'[DATE]),
        REMOVEFILTERS ( 'Export Worksheet'),
       'Export Worksheet'[Order] = CurrentCase,
        'Export Worksheet'[ProcessNumber] = PreviousIndex)
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @SandraGDS 

 

Please use this measure:

Timestamp =
VAR CurrentCase = 'Export Worksheet'[TRAY_NO]
VAR CurrentIndex = 'Export Worksheet'[STTN_NO_R]
VAR PreviousIndex =
    CALCULATE (
        MAX ( 'Export Worksheet'[STTN_NO_R] ),
        REMOVEFILTERS ( 'Export Worksheet' ),
        'Export Worksheet'[TRAY_NO] = CurrentCase,
        'Export Worksheet'[STTN_NO_R] < CurrentIndex
    )
RETURN
    CALCULATE (
        SELECTEDVALUE ( 'Export Worksheet'[AMD_DATE] ),
        REMOVEFILTERS ( 'Export Worksheet' ),
        'Export Worksheet'[TRAY_NO] = CurrentCase,
        'Export Worksheet'[STTN_NO_R] = PreviousIndex
    )

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @SandraGDS 

 

Please use this measure:

Timestamp =
VAR CurrentCase = 'Export Worksheet'[TRAY_NO]
VAR CurrentIndex = 'Export Worksheet'[STTN_NO_R]
VAR PreviousIndex =
    CALCULATE (
        MAX ( 'Export Worksheet'[STTN_NO_R] ),
        REMOVEFILTERS ( 'Export Worksheet' ),
        'Export Worksheet'[TRAY_NO] = CurrentCase,
        'Export Worksheet'[STTN_NO_R] < CurrentIndex
    )
RETURN
    CALCULATE (
        SELECTEDVALUE ( 'Export Worksheet'[AMD_DATE] ),
        REMOVEFILTERS ( 'Export Worksheet' ),
        'Export Worksheet'[TRAY_NO] = CurrentCase,
        'Export Worksheet'[STTN_NO_R] = PreviousIndex
    )

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

SandraGDS
New Member

SandraGDS_0-1685023037171.png

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors