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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
AudiencesQuesti
Frequent Visitor

How to create index within a grouping in a matrix

AudiencesQuesti_1-1721735748734.png

Hi, I'm trying to create a measure that results in the Index column above. Assume that there is a matrix with a few layers in it, Region, SubRegion, Fiscal Year, and then Accounts. I would like the Index to start at the Fiscal Year Level. See above for reference. Repetition across the level below (Accounts) may or may not be needed. Thank you!

 

1 REPLY 1
BeaBF
Super User
Super User

@AudiencesQuesti Hi! You need to calculate a new column like:

Index =
VAR CurrentRegion = 'YourTable'[Region]
VAR CurrentSubRegion = 'YourTable'[SubRegion]
VAR CurrentFiscalYear = 'YourTable'[FiscalYear]
RETURN
RANKX(
FILTER(
'YourTable',
'YourTable'[Region] = CurrentRegion &&
'YourTable'[SubRegion] = CurrentSubRegion &&
'YourTable'[FiscalYear] = CurrentFiscalYear
),
'YourTable'[Accounts],
,
ASC,
DENSE
)

 

if you paste sample data under your example, i can detail better the formula.

 

BBF

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.