Forum Discussion

matrix_user's avatar
matrix_user
Icon for Helper III rankHelper III
4 years ago
Solved

Calculated column & DAX for slicer issues.

Hi,   Is there anyone who can help? I am trying to work out how I could create the 'Desc' column below so that it can be used in a slicer. The fields pane shows that the 'Desc' column is somewhat a...
  • v-robertq-msft's avatar
    4 years ago

    Hi, 

    According to your description, I can roughly understand your requirement, I think you can try this DAX formula to achieve your requirement:

    You can create the calculated column [Desc] like this:

    Desc =
    
    IF(
    
        NOT(ISERROR(VALUE(LEFT('Slicer'[Period]))+1)),"Y",
    
        IF(
    
            NOT(LEFT('Slicer'[Period],1) in {"Q","W"}),"M",
    
            LEFT('Slicer'[Period],1)))

     

    And you can get what you want, like this:

     

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.