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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PBIfanatic
Helper V
Helper V

Summarized table without measure

Hi,

 

I have 2 tables shown below, they are related by ID(Account) and Account ID(Product)

Account
Account NameIDCountry
Acc1AC1US
Acc2AC2US

 

Product
Product IDAccount IDOwnerType
PRD1AC1MikeType1
PRD1AC1SamType2
PRD2AC1JohnType1
PRD2AC1SaraType2

 

And I want the output in a pivot table

 

 USSG
 Owner (Type)Owner (Type)
PRD1Mike (Type1)
Sam (Type2)
 
PRD2John(Type1)
Sara(Type2)
 

 

The data volume is close to a million in the accounts table so need to factor in performance as well. 

thanks for looking into this.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@PBIfanatic 

You create the following measure:

Owner Type = 
IF(
    ISINSCOPE( 'Product'[Product ID]) && ISINSCOPE( 'Account'[Country]), 
    CONCATENATEX(
        SUMMARIZE('Product' ,'Product'[Owner] ,'Product'[Type] ),
        'Product'[Owner] & "(" & 'Product'[Type] &")" & UNICHAR(10)
    ) 
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@PBIfanatic 

You create the following measure:

Owner Type = 
IF(
    ISINSCOPE( 'Product'[Product ID]) && ISINSCOPE( 'Account'[Country]), 
    CONCATENATEX(
        SUMMARIZE('Product' ,'Product'[Owner] ,'Product'[Type] ),
        'Product'[Owner] & "(" & 'Product'[Type] &")" & UNICHAR(10)
    ) 
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

thanks @Fowmy  

Thats an elegant solution. Another new function learnt. 🙂

 

I am also looking forward to how this is done in Power query from @CNENFRNL 

@PBIfanatic 

Great!,
Go ahead and accept a solution if it works for you, this will help others who look for similar solutions to find it easily. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

CNENFRNL
Community Champion
Community Champion

Seems weird a SG column comes out of nowhere from your mock dataset.

 

Whatever, it's a simple transformation in PQ

let
    Account = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckxONlTSUXJ0BpGhwUqxOmAxI7CYEUIMzI8PdgfSQCI2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Account Name" = _t, ID = _t, Country = _t]),
    Product = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCghyMVTSUXJ0BpG+mdmpQCqksiDVUClWB002ODEXKmkEkzSCS3rlZ+ShazVC0lqUiKI32D0eqAAsHx/sDqT98pPyUyqhaiKUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Product ID" = _t, #"Account ID" = _t, Owner = _t, Type = _t]),
    #"Combined Columns" = Table.CombineColumns(Product, {"Owner", "Type"}, each _{0}&" ("&_{1}&")", "Owner (Type)"),
    #"Grouped Rows" = Table.Group(#"Combined Columns", {"Product ID", "Account ID"}, {{"ar", each Text.Combine([#"Owner (Type)"], "#(lf)")}}),
    #"Merged Tables" = Table.NestedJoin(#"Grouped Rows", "Account ID", Account, "ID", "merged", JoinKind.LeftOuter),
    #"Expanded merged" = Table.RemoveColumns(Table.ExpandTableColumn(#"Merged Tables", "merged", {"Country"}, {"Country"}), "Account ID"),
    #"Pivoted Column" = Table.Pivot(#"Expanded merged", List.Distinct(#"Expanded merged"[Country]), "Country", "ar")
in
    #"Pivoted Column"

Screenshot 2021-10-17 064923.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

hi @CNENFRNL  

How do I get the grouping? When I try the Group by option in the Home tab,it doesnt allow me to do this without a measure.

   #"Grouped Rows" = Table.Group(#"Combined Columns", {"Product ID", "Account ID"}, {{"ar", each Text.Combine([#"Owner (Type)"], "#(lf)")}}),

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors