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
wcloninger
Helper I
Helper I

Flagging a the first time of a series based on another column

I want to flag the first occurence rows with a "1" of each incident number. I've seen a lot online, but I haven't seen anything based on another column.

wcloninger_0-1707150000872.png

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @wcloninger ,

 

If you run into a situation where the dates are all the same and it's hard to distinguish the first row, you can create an Index in the power query.

Here are the steps you can follow:

1. In Power Query -- add Column – Index Column – From 1.

vyangliumsft_0-1707192721943.jpeg

2. Create calculated column.

Test =
var _rank=
RANKX(
    FILTER(ALL('Table'),'Table'[records.Incident Number]=EARLIER('Table'[records.Incident Number])),
    [Index],,ASC)
return
IF(
    _rank=1,_rank,BLANK())

3. Result:

vyangliumsft_1-1707192721945.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @wcloninger ,

 

If you run into a situation where the dates are all the same and it's hard to distinguish the first row, you can create an Index in the power query.

Here are the steps you can follow:

1. In Power Query -- add Column – Index Column – From 1.

vyangliumsft_0-1707192721943.jpeg

2. Create calculated column.

Test =
var _rank=
RANKX(
    FILTER(ALL('Table'),'Table'[records.Incident Number]=EARLIER('Table'[records.Incident Number])),
    [Index],,ASC)
return
IF(
    _rank=1,_rank,BLANK())

3. Result:

vyangliumsft_1-1707192721945.png

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@wcloninger , A new column

 

if ([Record Creation date] = minx(filter(Table, [incident number] = earlier([incident number]) ), [Record Creation date]), 1, blank())

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

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.