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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Return columns from multiple tables

Hi,

 

I have the following scenario -

 

1 master summary table with multiple rows, each row includes a type.

 

Multiple detail tables (1 per type), some containing a sub type, and some not.  1 type doesn't have a matching detail table.  The rows in the detail tables use the same unique identifier as the corresponding row in the summary table.

 

Example

Summary table - 

Identifier     Desc                      Type 

1                 Row 1                    A

2                 Row 2                    A

3                 Row 3                    B

4                 Row 4                    C

5                 Row 5                    D

6                 Row 6                    D

7                 Row 7                    E

 

Detail table Type A -

Identifier    Sub Type

1                 A-1

2                 A-2

 

Detail table Type B - 

Identifier    Sub Type

3                 B-1

 

Detail table Type C -

Identifier

4                  No sub type

 

Detail table Type D -

Identifier    Sub Type

5                 D-1

6                 D-2

 

there is no detail table for type E.

 

What I am trying to do is build a table that can be filtered on the sub type (amongst other filters) where appropriate - so:

 

Slicer selects sub type A-1 - list displays row 1 only.

Identifier     Desc                      Type     Sub Type

1                 Row 1                    A           A-1

 

Slicer selects sub type D-1 - list displays rows 5 & 6 only.

Identifier     Desc                      Type     Sub Type

5                 Row 5                    D           D-1

6                 Row 6                    D           D-1

 

Slicer selects blank sub type - list displays rows 4 & 7 only

Identifier     Desc                      Type     Sub Type

4                 Row 4                    C

7                 Row 7                    E

 

Slicer has no select - list displays all rows. 

Identifier     Desc                      Type     Sub Type

1                 Row 1                    A           A-1

2                 Row 2                    A           A-2

3                 Row 3                    B           B-1

4                 Row 4                    C

5                 Row 5                    D           D-1

6                 Row 6                    D           D-1

7                 Row 7                    E

 

I'm new to Power BI, but wouldn't have any problem with SQL or SSRS.  I'm restricted to using a supplier developed model - I can create new measures, but not new columns.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the suggestions - looking at them lead me down another path and I found the best solution (for me at least) is to create a series of measures to extract the sub-type for each row -

Sub Type MST1 =
CALCULATE (
    VALUES ('REC_TYPE1'[ST1] ) ,
    FILTER (
        'MASTER TABLE' ,
        'MASTER TABLE'[Rec ID] = SELECTEDVALUE ( 'MASTER TABLE'[Rec ID] )
    )
)
 then MST2, MST3, MST4.
 
And then use another measure to concatenate the individual type measures -
Sub-Type =
CONCATENATE (
    'MASTER TABLE'[MST1] ,
    CONCATENATE (
        'MASTER TABLE'[MST2] ,
        CONCATENATE (
            'MASTER TABLE'[MST3] ,
           'MASTER TABLE'[MST4]
        )
    )
)

View solution in original post

10 REPLIES 10

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.