cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
giorgiokatr Member
Member

table with dynamic values (columns)

is it possible in a table to have dynamic values depending on a slicer?

 

 

Rows will have Branch

and values will have different columns each time i select a value from a slicer

(eg sales when i select sales etc)

each value is a different column on my database

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: table with dynamic values (columns)

Hi @giorgiokatr,

 

Sorry, It seems like I have forgot to paste the measures.

 

field1 =SWITCH([Selected],"Sales",Max(Table[Col1]),"Other",Max(Table[Col3]))
field2 =SWITCH([Selected],"Sales",Max(Table[Col2]),"Other",Max(Table[Col4]))

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

13 REPLIES 13

Re: table with dynamic values (columns)

Hi @giorgiokatr

 

look at my previous answer at https://community.powerbi.com/t5/Desktop/Changing-column-graph-displayed-value/m-p/108427/highlight/... - this is a good pattern to make it work like you want 🙂

 

HTH,

Frank

giorgiokatr Member
Member

Re: table with dynamic values (columns)

thanks @BetterCallFrank!

switch i a good solution but i would like to have 5 values for example not only one depending on slicer selection.

example when i select sales from slicer to have in a table my 5 sales columns (phone sales, laptop sales eg)

when i select profit to have my other 5 profit columns...

CheenuSing Super Contributor
Super Contributor

Re: table with dynamic values (columns)

Hi @giorgiokatr

 

Can you share some data and the visual you expect to understand the problem better.  You can do this on onedrive and post the link

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
Baskar Super Contributor
Super Contributor

Re: table with dynamic values (columns)

Cool,

 

1. We can't change the calculated column value while selecting in slicer.

 

but we can achieve whatever u looking for with the help of Calculated measure. please share your fromula .

giorgiokatr Member
Member

Re: table with dynamic values (columns)

i am sharing my pbix to help you understand if it is possible!

https://drive.google.com/file/d/0Bw-_YmJ3Q49gTzVKUjdhUEZUQ0U/view?usp=sharing

Community Support Team
Community Support Team

Re: table with dynamic values (columns)

Hi @giorgiokatr,

 

You can refer to below method to show the dynamic fields value.

 

Add a index column to current table.(let measure calculate all the rows)

 Capture.PNG

 

Add a measure to slicer's source table to get the selected value.

Selected = if(HASONEVALUE(selection[Slicer]),VALUES(selection[Slicer]),BLANK())

 

Create the table visual.

Capture2.PNG

 

Result:

Capture3.PNGCapture4.PNG

Notice: if table not contain the index column, it will only show one value.

 

Capture5.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
giorgiokatr Member
Member

Re: table with dynamic values (columns)

thanks @v-shex-msft! what is the dax formula for field1 and field2?

Community Support Team
Community Support Team

Re: table with dynamic values (columns)

Hi @giorgiokatr,

 

Sorry, It seems like I have forgot to paste the measures.

 

field1 =SWITCH([Selected],"Sales",Max(Table[Col1]),"Other",Max(Table[Col3]))
field2 =SWITCH([Selected],"Sales",Max(Table[Col2]),"Other",Max(Table[Col4]))

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

giorgiokatr Member
Member

Re: table with dynamic values (columns)

thanks @v-shex-msft great and clever solution!

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)