This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I have a measure called Top Customer that is calculated in a sales table. It identifies the customer code an item is sold to the most.
Top Customer =
FIRSTNONBLANK (
TOPN (
1,
VALUES ( Sales[CustomerID] ),
RANKX( ALL( Sales[CustomerID] ), _Measures[Times Imported],,ASC)
),
1
)
I would like to return this measure in the context of my inventory table.
I do have an intermediate table called Item Branch that has all unique items as there are duplicates in the inventory and sales table.
Expected Output as table visual:
Inventory.Item TopCustomer
A AA
B AB
Thanks in advance and any SQLBI or related articles, I love to read.
Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?
Refer to:
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
Best Regards,
Eyelyn Qin
@EnrichedUser is it kindly possible to provide a pbix (small) representative of your issue
@EnrichedUser , I doubt you can get it for an inventory item easily. what is the difference between Inventory.Item and ItemBranch.ItemID - are there more than one description, because you should try the same ItemBranch.ItemID or ItemBranch.Item
Item Branch is just a table with unique items.
Inventory has duplicates of items and sales has duplicates.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 28 | |
| 27 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 66 | |
| 36 | |
| 33 | |
| 26 | |
| 24 |