Forum Discussion

jeanL's avatar
jeanL
Icon for Helper I rankHelper I
4 years ago
Solved

Create slicer on calculated column

Hello 

 

I am trying to have a slicer which display based on the ratio_teu.

However, the default slicer creation has an in between / range. 

I learnt somewhere that it can be done with What -If Parameter slicer and i manage to do it with measures.

But this ratio_teu is a calculated column and i wasnt sure how to connect this to the what if slicer. 

 

  • Hi jeanL ,

     

    If you are summing column [ratio_teu%] in the visual,

     

     

    then please try the following formula.

     

    Measure2 = 
    COUNTROWS (
        FILTER (
            SUMMARIZE (
                vendor_final,
                vendor_final[p2p_pair],
                vendor_final[vendor_master_name],
                "_sum", SUM ( vendor_final[ratio_teu%] )
            ),
            [_sum] >= 'Min. Contribution %'[Min. Contribution % Value]
        )
    )

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • jeanL , A column can be used in the slicer and you can use the range option.

    If you need what that you can use what if values in filter clasue

     

    example  measures

    countrows(filter(Table, Table[Column] = [what if measure]))

     

    measure  =

    var _min = minx(allselected(whatif), whatif[Value])

    var _max = maxx(allselected(whatif), whatif[Value])

    return

    countrows(filter(Table, Table[Column] <= _max &&Table[Column] >= _min   ) ) 

    • jeanL's avatar
      jeanL
      Icon for Helper I rankHelper I

      HI amitchandak 

       

      I tried the solution you have shared. 

       

      measures = countrows(filter(vendor_final, vendor_final[ratio_teu%] >= 'Min. Contribution %'[Min. Contribution % Value]))
       
      but it does not seem to link as i intend. i would like to filter the rows  where if the ratio is at least the minimum in the slicer. some which are greater than the value in the slicer was not counted. 
      • v-kkf-msft's avatar
        v-kkf-msft
        Icon for Community Support rankCommunity Support

        Hi jeanL ,

         

        If you are summing column [ratio_teu%] in the visual,

         

         

        then please try the following formula.

         

        Measure2 = 
        COUNTROWS (
            FILTER (
                SUMMARIZE (
                    vendor_final,
                    vendor_final[p2p_pair],
                    vendor_final[vendor_master_name],
                    "_sum", SUM ( vendor_final[ratio_teu%] )
                ),
                [_sum] >= 'Min. Contribution %'[Min. Contribution % Value]
            )
        )

        If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
        Best Regards,
        Winniz
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.