Forum Discussion

giorgiokatr's avatar
giorgiokatr
Helper V
9 years ago
Solved

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

 

  • Anonymous's avatar
    Anonymous
    9 years ago

    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

14 Replies

    • giorgiokatr's avatar
      giorgiokatr
      Helper V

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

      • Anonymous's avatar
        Anonymous
        Not applicable

        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

  • Baskar's avatar
    Baskar
    Resident Rockstar

    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 .

      • Anonymous's avatar
        Anonymous
        Not applicable

        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)

         

         

        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.

         

        Result:

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

         

         

        Regards,

        Xiaoxin Sheng

  • Anonymous's avatar
    Anonymous
    Not applicable

    I need some expertise here.

    I have imported excel from sharepoint in power bi as dataset.

    In power bi desktop i have connected it as live dataset using get data method.

    Now the issue is that i want to create the dynamic axis using modelling》parameter》field parameter. But it seems that the parameter is greyedout.

     

    Any expert please suggest how can i create dynamic axis [field headers]