Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello! I've looked for an answer to this all over the place, and I can't find anyone directly addressing it.
In the Microsoft DAX documentation, it gives this example for the EARLIER function:
| ProductSubcategoryKey | EnglishProductSubcategoryName | TotalSubcategorySales | SubcategoryRanking |
| 18 | Bib-Shorts | $156,167.88 | 18 |
| 26 | Bike Racks | $220,720.70 | 14 |
| 27 | Bike Stands | $35,628.69 | 30 |
| 28 | Bottles and Cages | $59,342.43 | 24 |
| 5 | Bottom Brackets | $48,643.47 | 27 |
= COUNTROWS(FILTER(ProductSubcategory, EARLIER(ProductSubcategory[TotalSubcategorySales])<ProductSubcategory[TotalSubcategorySales]))+1
In trying to apply this to my use case, I get an error telling me that my column name isn't recognized:
The SalesOrder column is not a calculated column or a measure, but a column imported from my data source.
Solved! Go to Solution.
Hi @pwe5000 ,
EARLIER will return the current value in a calculated column, not a measure. In a measure, MAX/MIN/SUM can return the current value.
According to your description, I create a sample. I create a calculated column by your formula, it calculates the number of SalesOrders that are the same as the current SalesOrder.
If you want to filter out all duplicates, here's my solution.
1.Add a index column in Power Query.
2.Create a calculated column.
Rank =
RANKX (
FILTER (
'Hobart Sales on Ebay',
'Hobart Sales on Ebay'[SalesOrder]
= EARLIER ( 'Hobart Sales on Ebay'[SalesOrder] )
),
'Hobart Sales on Ebay'[Index],
,
ASC,
DENSE
)
Get this table.
3.By selecting Rank is 1, it will filter out all duplicates.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @pwe5000 ,
EARLIER will return the current value in a calculated column, not a measure. In a measure, MAX/MIN/SUM can return the current value.
According to your description, I create a sample. I create a calculated column by your formula, it calculates the number of SalesOrders that are the same as the current SalesOrder.
If you want to filter out all duplicates, here's my solution.
1.Add a index column in Power Query.
2.Create a calculated column.
Rank =
RANKX (
FILTER (
'Hobart Sales on Ebay',
'Hobart Sales on Ebay'[SalesOrder]
= EARLIER ( 'Hobart Sales on Ebay'[SalesOrder] )
),
'Hobart Sales on Ebay'[Index],
,
ASC,
DENSE
)
Get this table.
3.By selecting Rank is 1, it will filter out all duplicates.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@pwe5000 what you are trying to achieve?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi parry2k,
Good point! It's also possible that there's a more effective way to do this: I want this measure to identify duplicates in the SalesOrder column. I don't want to remove the duplicates completely, but I do want to be able to use this new column to filter out all duplicates in the SalesOrder column (i.e. not keeping one copy of each duplicate).
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 76 | |
| 52 | |
| 51 | |
| 46 |