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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Need to create levels of hierarchy

Hi All,

Below is my sample data,

 

RohiniP-26_4-1609960914076.png

 

My table has 3 columns, No, start No and end No. Start and end No is the begining and Ending of 'No' range, but it is given at the end row of each range. I need to split this into range of hierarchy levels. Below is my expected output,

RohiniP-26_5-1609960963191.png

 

1000 - 1005 and 2000 - 2002 is the first level of hierarchy ,101-200 and 201-300 is the second level of hierarchy, 10 - 11 is the third level of hierarchy. I want to put the starting range No in the respective columns (ie...first,second,third level).

 

I need to calculate the last 3 columns using dax or power query.

 

Thanks in Advance....

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , I think you may get first one like this

First Level =
maxx(filter(Table, [no] >= earlier([Start No]) && [no] <=earlier([end No]) && [Start No] >=1000 && [no] >=1000),[Start No])

 

For second and thrid you need have index and more complex calcultion. Unless data in in table format I can not try.

 

But I also think this not a good data to work with.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
lbendlin
Super User
Super User

Tell whoever provided you with the source data that it is of insufficient quality. Ask them for better source data.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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