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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Memorable Member
Memorable Member

@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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.