Forum Discussion

josh_sheffield's avatar
josh_sheffield
Frequent Visitor
8 years ago
Solved

Slicing by calculated column header

I'm wanting to create a slicer based upon the header of two calculated columns. Is this possible?


If I wanted to slice based upon a traditional colum header I would go into the query editor and unpivot the columns but obviously this is not possible with calculated columns.

 

Thanks in advance.

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi josh_sheffield,

     

    >>What I am trying to achieve is a slicer to turn the upper and lower limit lines on/off.

    You can create a if parameter table as source of slicer to control limit lines measure display or hide.

     

    Below is sample.

     

    Table:

    Variable = GENERATESERIES(0, 1, 1)

     

    Measures

    Selected = SELECTEDVALUE(Variable[Parameter])

    maxline = IF ( [Selected] = 1, MAX ( 'Table'[Amount] ), 0 ) minline = IF ( [Selected] = 1, AVERAGE ( 'Table'[Amount] ), 0 )

     

    Regards,

    Xiaoxin Sheng

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI josh_sheffield,

     

    For your requirement, you can create a table to store column headers and use it to create a slicer.

    After these steps, you can write a measure to get selected item from slicer, then you can use measure result as parameter to calculate with other conditions.

     

    If above not help, please provide detail contents and expected result to help us clarify your scenario.

     

    Regards,

    Xiaoxin Sheng

    • josh_sheffield's avatar
      josh_sheffield
      Frequent Visitor

      Thanks for your reply. Sorry but I'm not sure on how I should implement this: 

      Anonymouswrote:

       

      After these steps, you can write a measure to get selected item from slicer, then you can use measure result as parameter to calculate with other conditions.

       

      I have the following data, where RH Upper and RH Lower are calculated columns:

       

       

      I use this data to create the following plot: 

       

       

      What I am trying to achieve is a slicer to turn the upper and lower limit lines on/off.

       

      I've created a table to store the column headers "RH Upper" and "RH Lower" but not sure where to go from there.

       

      Kind Regards,

       

      Josh

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi josh_sheffield,

         

        >>What I am trying to achieve is a slicer to turn the upper and lower limit lines on/off.

        You can create a if parameter table as source of slicer to control limit lines measure display or hide.

         

        Below is sample.

         

        Table:

        Variable = GENERATESERIES(0, 1, 1)

         

        Measures

        Selected = SELECTEDVALUE(Variable[Parameter])

        maxline = IF ( [Selected] = 1, MAX ( 'Table'[Amount] ), 0 ) minline = IF ( [Selected] = 1, AVERAGE ( 'Table'[Amount] ), 0 )

         

        Regards,

        Xiaoxin Sheng