Forum Discussion

mwen90's avatar
mwen90
Helper III
5 years ago

Filter across multiple columns one table

Hi, 

 

Thanks for the help.

 

I was looking to display a column of comments if the value "D" is displayed. The issue is, if I filter one column to show "D" then all other columns filter so I am missing out on values. 

 

How can I filter each column so it does't affect the others in my table or filter the whole table so only "D" shows and the corresponding commet?

 

Cheers,

6 Replies

  • mwen90 , Try one of the 4

     

    if(max(table[water_concerting_choice]) = "D", max([water_concerting_comment]),blank())
    or
    if(max(table[water_concerting_choice])= "D", max([water_concerting_comment]),"")

    or

    calculate(max([water_concerting_comment]), filter(Table,table[water_concerting_choice]= "D"))

    or
    calculate(max([water_concerting_comment]), filter(Table,table[water_concerting_choice]= "D")) & ""

    • mwen90's avatar
      mwen90
      Helper III

      Sorry, am I meant to try all of these in one equation? or each line seperate?

      The bottom to say we cannot convert "D" type text to a type Number @amitchandak

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  mwen90 ,

    According to your description, I created some data to show:

    Here are the steps you can follow:

    1. Create measure.

    switch_water_concreting_comment =
    SWITCH(
        TRUE(),
        MAX('Table'[water_ concreting_ choice ])="D","Comments to output",
        MAX('Table'[water_concreting_Value]))

    2. Result.

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

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

    • mwen90's avatar
      mwen90
      Helper III

      Wow thank you all for the feedback and help!

      I will try these now!

    • mwen90's avatar
      mwen90
      Helper III

      Sorry, I am having issues with this solution. It is producing only 1 possible "D" answer, I want to see all of the "D" Comments in the column @v-yangliu-msft

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  mwen90 ,

    According to your description, I created an additional column water of [comment_ concreting_ comment_ true]:

     

    Here are the steps you can follow:

    1. Create measure.

    switch_water_concreting_comment =
    SWITCH(
        TRUE(),
        MAX('Table'[water_ concreting_ choice ])="D",MAX('Table'[water_concreting_comment_true]),
        MAX('Table'[water_concreting_Value]))

    2. Result.

    You can downloaded PBIX file from here.

    If my answer is not what you need, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

     

    Best Regards,

    Liu Yang

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