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

Change the Calculated Column values in a table in Power BI based on the slicer value

Hi All,

This post is all about changing the calculated column values in a table in power bi according to the parameter value selected by the user from a slicer.

 

I came across a situation in my project. I wanted to create a table visual which shows the measure values against a Calculated column named Dimension1. The  slicer contains a set of values which are the names of columns from different tables.

 

Values in Dimnesion1 should automatically change and show the corresponding values according to the parameter that user selects.

i.e. if user selects the parameter value-‘Reporting Segment’, the Dimension1 column in Matrix table should contain the values coming under the column Reporting Segment in another table.

I have tried to achieve this by creating a table with single column having the list of parameter values and in order to have a relation between the main table and parameter table, I cross joined the 2 tables and created a new table and that is working fine. But my main table have 7 million records and the parameter table have 15 records so while cross joining  I am getting 95 million record which is making the pbix file size 900 MB and the file is getting slower.

Could you please help me in providing any work around.

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous 

 

In general, calculated columns are not dynamic, they are calculated at the time of data load and not again until the next data load. Need to use measures to get dynamic behavior.

 

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Anonymous
Not applicable

Here we need a calculated column, because if the user selects Reporting Segment from the slicer, the related table visual should show the values in the column Reporting Segment from a different table.

 

Thanks

Anonymous
Not applicable

can you share some sample data and expected output.

Anonymous
Not applicable

Please find the tables below:

MAIN TABLE
Employee_IDEMP_NAMESalarySegmentKeyUnit_key
123ABC$3,50015
435GHI$3,00038
678IOP$4,00042

 

Segment Table
Segment_KeyReporting Segment
1seg1
2seg2
3seg3
4seg4
5seg5

 

Unit Table
Unit_KeyReporting Unit
1unit1
2unit2
3unit3
4unit4
5unit5


The Main Table is linked with the Segment table using Segment_Key and Unit table using Unit_Key. Our requirment is, we will have a slicer  

Reporting Segment
Reporting Unit

 

When we select Reporting Segment from the slicer we need a table in the visual having a column with values from column Reporting Segment. i.e our query will be like IF(SelectedValue (Slicer)="Reporting Segment", RELATED(Segment Table[Reporting Segment])). But this will not work.

Anonymous
Not applicable

So your requirement is you need to have column names in slicers and user have flexibility to select the columns in table.
Unfortunately in power BI this functionality is not possible.
You can do one thing...you can create hierarchy and add that hierarchy in table. And provide self service BI to users to select/remove column from hirrarchy in table as per their requirement

Thanks & regards,
Pravin Wattamwar

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.

Top Solution Authors