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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Colum need to separate by the data category

Hello Everyone, 

Please can someone help me to achive the below output uisng PowerBI 


Original Data 

Sector Path
AEG_BAML_CASH.N/A BAML RATING. BAE3N75F8
AEG_BAML_CASH.N/A BAML RATING. BAE3N75F7
AEG_BAML_CASH.N/A BAML RATING. BAE3N75G8
AEG_BAML_CASH.N/A BAML RATING. BAE3N75F9
AEG_BAML_CASH.N/A BAML RATING. BAE3N75H8
BY_RCOUNTRY_AEG.North America.United States.BAE83QD3
BY_RCOUNTRY_AEG.Europe.Germany.BAE83QD4
BY_RCOUNTRY_AEG.BAE83QD5
BY_RCOUNTRY_AEG.United States.BAE83QD6
BY_RCOUNTRY_AEG.United States.BAE83QD7
 



Data After Split by delimeter 

Sector Path1Sector Path2Sector Path 3Sector Path4
AEG_BAML_CASHN/A BAML RATINGBAE3N75F8 
AEG_BAML_CASHN/A BAML RATINGBAE3N75F7 
AEG_BAML_CASHN/A BAML RATINGBAE3N75G8 
AEG_BAML_CASHN/A BAML RATINGBAE3N75F9 
AEG_BAML_CASHN/A BAML RATINGBAE3N75H8 
BY_RCOUNTRY_AEGNorth AmericaUnited StatesBAE83QD3
BY_RCOUNTRY_AEGEuropeGermanyBAE83QD4
BY_RCOUNTRY_AEGBAE83QD5  
BY_RCOUNTRY_AEGUnited StatesBAE83QD6 
BY_RCOUNTRY_AEGUnited StatesBAE83QD7 



Expected Output 

Sector Path1Sector Path2Sector Path 3Sector Path4
BY_RCOUNTRY_AEGNorth AmericaUnited StatesBAE83QD3
BY_RCOUNTRY_AEGEuropeGermanyBAE83QD4
BY_RCOUNTRY_AEG  BAE83QD5
BY_RCOUNTRY_AEG United StatesBAE83QD6
BY_RCOUNTRY_AEG United StatesBAE83QD7

 

 @dax @Desktop 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

Sector Path2_column =
var _left=LEFT([Sector Path2],3)
return
IF(_left in {"Uni","BAE"},BLANK(),[Sector Path2])
Sector Path3_column =
var _left=LEFT([Sector Path3],3)
return
IF(_left in {"Uni","Ger"},'Split_Table'[Sector Path3],
IF(
    _left in {"BAE"},"United States",BLANK()
))
Sector Path4_column =
var _left=LEFT([Sector Path4],3)
var _1=CALCULATE(MAX('Split_Table'[Sector Path2]),FILTER(ALL('Split_Table'),'Split_Table'[Sector Path1]=EARLIER('Split_Table'[Sector Path1])&&'Split_Table'[Sector Path2]=EARLIER('Split_Table'[Sector Path2])))
var _2=CALCULATE(MAX('Split_Table'[Sector Path3]),FILTER(ALL('Split_Table'),'Split_Table'[Sector Path1]=EARLIER('Split_Table'[Sector Path1])&&'Split_Table'[Sector Path2]=EARLIER('Split_Table'[Sector Path2])&&'Split_Table'[Sector Path3]=EARLIER('Split_Table'[Sector Path3])))
return
IF(_left in {"BAE"},'Split_Table'[Sector Path4],
IF(
    LEFT(_1,3)in{"BAE"},_1,
    IF(
        LEFT(_2,3)in{"BAE"} ,_2,BLANK())))

2. Create calculated table.

Summarize_Table =
var _sum=FILTER('Split_Table',LEFT('Split_Table'[Sector Path1],2) in {"BY"})
return
SUMMARIZE(_sum,[Sector Path1],[Sector Path2_column],[Sector Path3_column],[Sector Path4_column])

3. Result:

vyangliumsft_0-1641521335911.png

 

Best Regards,

Liu Yang

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

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

Sector Path2_column =
var _left=LEFT([Sector Path2],3)
return
IF(_left in {"Uni","BAE"},BLANK(),[Sector Path2])
Sector Path3_column =
var _left=LEFT([Sector Path3],3)
return
IF(_left in {"Uni","Ger"},'Split_Table'[Sector Path3],
IF(
    _left in {"BAE"},"United States",BLANK()
))
Sector Path4_column =
var _left=LEFT([Sector Path4],3)
var _1=CALCULATE(MAX('Split_Table'[Sector Path2]),FILTER(ALL('Split_Table'),'Split_Table'[Sector Path1]=EARLIER('Split_Table'[Sector Path1])&&'Split_Table'[Sector Path2]=EARLIER('Split_Table'[Sector Path2])))
var _2=CALCULATE(MAX('Split_Table'[Sector Path3]),FILTER(ALL('Split_Table'),'Split_Table'[Sector Path1]=EARLIER('Split_Table'[Sector Path1])&&'Split_Table'[Sector Path2]=EARLIER('Split_Table'[Sector Path2])&&'Split_Table'[Sector Path3]=EARLIER('Split_Table'[Sector Path3])))
return
IF(_left in {"BAE"},'Split_Table'[Sector Path4],
IF(
    LEFT(_1,3)in{"BAE"},_1,
    IF(
        LEFT(_2,3)in{"BAE"} ,_2,BLANK())))

2. Create calculated table.

Summarize_Table =
var _sum=FILTER('Split_Table',LEFT('Split_Table'[Sector Path1],2) in {"BY"})
return
SUMMARIZE(_sum,[Sector Path1],[Sector Path2_column],[Sector Path3_column],[Sector Path4_column])

3. Result:

vyangliumsft_0-1641521335911.png

 

Best Regards,

Liu Yang

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

Watsky
Solution Sage
Solution Sage

Hey @Anonymous, 

Can you show us what the end result should look like?


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

Anonymous
Not applicable

Hello @Watsky updated

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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