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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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