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
rhayward2209
Helper I
Helper I

Creating a hierarchy using data points

Hi There,

 

When the data i use is exported it loses the hierarchy that is set in the database and I am trying to reinstate that so that the data flows up and down properly. An example of what I have is below.

 

Hierarchy        Group                  Order Number           Cost            Revenue 

 

****             Header Group            123456                   1000             2000

***              Sub Group 1               123456-01              600               1200

**               Individual Order 1      123456-01-01         450               850

**               Individual Order 2       123456-01-02         150              350

***             Sub Group 2                123456-02              400              800

**              Individual Order 1        123456-02-01         350               700

**              Individual Order 2         123456-02-02         50                100

 

Because of the way it is set up when i visualise it I get duplicated values since it pulls both the value for the Sub group and its individual orders, rather than having the individual orders as additonal data points. Is there any way I can transform it to actually gain back the heirarchy?

 

My End goal is to be able to have a Matrix where I can have:

                                                                                Cost                                 Revenue

Header group                                                         1000                                 2000

        -> Sub Group 1                                                 600                                   1200

                        -> Individual Order 1                        450                                    850

                        -> Individual Order 2                         150                                    350

etc...

 

Any help would be great.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rhayward2209 ,

 

Based on your description, you can create a calculated table as follows.

Test = 

var x1=SUMMARIZE(FILTER('Table',LEFT([Group],3)="Ind"),[Group],'Table'[Order Number],'Table'[Cost],'Table'[Revenue])

return

ADDCOLUMNS(x1,"Sub",IF(LEFT(RIGHT([Order Number],5),2)="01","Sub Group 1","Sub Group 2"),"Head","Header Group")

Result:

v-yuaj-msft_0-1615776605980.png

v-yuaj-msft_1-1615776614573.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @rhayward2209 ,

 

Based on your description, you can create a calculated table as follows.

Test = 

var x1=SUMMARIZE(FILTER('Table',LEFT([Group],3)="Ind"),[Group],'Table'[Order Number],'Table'[Cost],'Table'[Revenue])

return

ADDCOLUMNS(x1,"Sub",IF(LEFT(RIGHT([Order Number],5),2)="01","Sub Group 1","Sub Group 2"),"Head","Header Group")

Result:

v-yuaj-msft_0-1615776605980.png

v-yuaj-msft_1-1615776614573.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

rhayward2209
Helper I
Helper I

Is my best bet trying to create another data set that works as an index for how the hierarchy and relationships work for this data?

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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