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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
cfurminger
Frequent Visitor

Creating a Index Based off Several Conditions

Hello, 

 

I am trying to create a custom index that works off the 'Item' and 'Date'. For Example, I want it to reset each time a item has a matching item and the same date. But add 1 for every time a item & date match. 

 

See below example, for coloum 'Test Index' I have used the following formula, how do I get the coloum to look like 'Desried Outcome' column (I typed manually)

 

Test Index = COUNTX (
FILTER(Purchasing_Transaction,
EARLIER(Purchasing_Transaction[item]) = Purchasing_Transaction[Item] && Purchasing_Transaction[Date: Container Arrived at Warehouse] = Purchasing_Transaction[Date: Container Arrived at Warehouse] && EARLIER(Purchasing_Transaction[Date: Container Arrived at Warehouse]) >= Purchasing_Transaction[Date: Container Arrived at Warehouse]),Purchasing_Transaction[item])

 

Table: Purchasing_Transaction

Screenshot 2024-02-13 111023.png

@Daniel29195 @amitchandak @Ritaf1983 @Ahmedx 

1 ACCEPTED SOLUTION

if you need a measure you still need to add an index column first

Screenshot_1.png

View solution in original post

6 REPLIES 6
Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

and this with use GroupKind.Local

 

Thankyou, although I cant see the measure?

if you need a measure you still need to add an index column first

Screenshot_1.png

this code M in power query

lbendlin
Super User
Super User

read about GroupKind.Local  and apply it to the date

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.