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
code4578
Regular Visitor

Filter/Display the "column headers" of Table1 based on the rows of other table "Table2[column]"

Hello. Thanks to this awesome community, I was able to find certain solutions. Unfortunately - until now. 

 

I have 2 tables Table1 and Table 2. I am looking display/filter only the columns of Table1 based on the rows/values of Table2[columnName]. 

 

The values of Table1[Name] and Table2[NAME] are same. The Column Headers of Table1 are the values of Table2[columnName]. 

 

On the visuals, I have a slicer of Table2[columnName]. I want to display specific column Names of Table1 based on the selection from the slicer. 

 

I tried unpivot column - this works but I have more than million rows from Table1 and it would be nice to remain in the form of Table1. The reason is from the Table1[Name] - we would able to identify the lines based on the Names. So I am looking apart from unpivot. 

 

Also please note - the column headers of Table1, contain any data form. 

 

Table1      
      
NameABCDE
Name1textNumbertextNumbertext
Name1NumberDateNumberDateNumber
Name2DatetextDatetextDate
Name21.6DecimalDecimal2.8Decimal
Name3texttexttexttexttext
etc     

 

Table2 
  
columnNameNAME
AName1
BName1
CName3
DName3
EName2

 

Many thanks as always . 

 

Regards 

2 REPLIES 2
code4578
Regular Visitor

Hi Liu, 

 

Many thanks for your reply. This solution gave me the idea. Unfortunately I have few set backs,

  1. Duplicated Values - I have numerous values that are duplicated in Table2[columnName] and hence I encountered the error - of duplicated values (it says this is not allowed for many to one relationship or for columns that are used as the primary key of a table)
  2. The values of Table2[columnName] ; (A, B, C etc...) - I have too many values; that is, about 937 values/rows. So, in Table1 - about 937 columns and with more than 2 million rows. 

Thanks for your patience. look forward your thoughts in this regard. 

Regards 

v-yangliu-msft
Community Support
Community Support

Hi  @code4578 ,

 

Here are the steps you can follow:

1. Modeling – New parameter -- Fields.

vyangliumsft_0-1677122781104.png

Select Table1 [A], [B], [C], [D] , [E]

vyangliumsft_1-1677122781105.png

2. Joining two tables to each other.

vyangliumsft_2-1677122781107.png

3. Use Table2 [Name] as slicer

vyangliumsft_3-1677122781108.png

4. Place Parameter Table[Parameter Table] and Table1[Name] into it.

vyangliumsft_4-1677122781110.png

5. Result:

vyangliumsft_5-1677122781111.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

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.