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

Swapping sets of columns in a table based on role type

Hi Everyone,

 

I have a parameter in Power BI which is for a Role type. Based on the role you select, it replaces the role column in a table with the relevant role selected.

 

What I am trying to do is, based on the role selected, it will also insert a number of other relevant columns into the table.

Example:
If Role 1 is selected, also insert columns:

Role 1 Start Date 

Role 1 Rework Date

Role 1 End Date

 

If Role 2 is selected:

Role 2 Start Date

Role 2 Rework Date

etc

 

Admittedly, I am very new to Power BI, but have searched for this scenario on the internet and cannot find a solution.

 

 

1 ACCEPTED SOLUTION

Hi @Jays_D ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1688692964269.png

Please try:

First create a field parameter:

vjianbolimsft_1-1688693143235.png

Then add a new column to the parameter table:

vjianbolimsft_2-1688693319435.png

Then use the 'Role' column to create a slicer:

vjianbolimsft_3-1688693398261.png

Final output:

vjianbolimsft_4-1688693413270.png

vjianbolimsft_5-1688693423152.png

Best Regards,

Jianbo Li

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

6 REPLIES 6

Greatly appreciate your response @amitchandak . Let me try to explain, the articles above don't cover what I am hoping to achieve.

I have the following columns:

Role 1 Name

Role 1 Start Date

Role 1 Rework date

Role 1 End Date

 

Role 2 Name

Role 2 Start Date

Role 2 Rework date

Role 2 End Date

 

Role 3 Name

Role 3 Start Date

Role 3 Rework date

Role 3 End Date

 

I have a Parameter already setup called "Roles" which consists of:

Role 1 Name

Role 2 Name

Role 3 Name

 

This Parameter I have as a column in my table so whenever I select (for example) Role 1, the "Role" column in my table only shows Role 1 Name.

 

What I want to do is:

When I select "Role 1" I also want it to show in the table:

Role 1 Start Date

Role 1 Rework date

Role 1 End Date

Hi @Jays_D ,

 

Is your data Role1 xxxx one column of data or two columns of data?

vjianbolimsft_0-1688625907321.pngvjianbolimsft_1-1688626057962.png

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

Thanks for the response @v-jianboli-msft .

Each is it's own column. Example

Role 1 NameRole 1 Start DateRole 1 Rework DateRole 1 End DateRole 2 NameRole 2 Start DateRole 2 Rework  Date

Role 2 

End Date

Role 3 Nameetc

 

How I envision this working, is a parameter which has Role 1, Role 2, Role 3 etc

 

If I select Role 1 in the Parameter it adds to my table:

Role 1 NameRole 1 Start DateRole 1 Rework DateRole 1 End DateStatic ColumnStatic ColumnStatic ColumnStatic ColumnStatic ColumnStatic Column

 

Then, perhaps I select Role 2 in my Parameter which then swaps out the relevant columns in my table:

Role 2 NameRole 2 Start DateRole 2 Rework DateRole 2 End DateStatic ColumnStatic ColumnStatic ColumnStatic ColumnStatic ColumnStatic Column

 

I'd like to avoid sample data sets if I can as I am very new to Power BI and work in a Financial Institution, I am just not at a comfortable level - I do apologies.

Hopefully the above will paint a clearer picture? Thank you so much again for taking the time to respond.

Hi @Jays_D ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1688692964269.png

Please try:

First create a field parameter:

vjianbolimsft_1-1688693143235.png

Then add a new column to the parameter table:

vjianbolimsft_2-1688693319435.png

Then use the 'Role' column to create a slicer:

vjianbolimsft_3-1688693398261.png

Final output:

vjianbolimsft_4-1688693413270.png

vjianbolimsft_5-1688693423152.png

Best Regards,

Jianbo Li

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

Thank you @v-jianboli-msft !
This is precisely what I was looking for ! Truly appreciate this, has solved a majot bug bear for me !

Apologies for the late response.

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.