Forum Discussion

GoingIncognito's avatar
GoingIncognito
Icon for Advocate III rankAdvocate III
6 years ago
Solved

Filter one table to only include values that have equaling values in two columns

My question is fairly simple:

On a report page all I need to display is a table. And this table receives all the rows from database table as is. Only one filter needs to be used: Table[Date1] = Table[Date2]. I'm comparing two different date values from the same table. All these rows gets to go into the report page. Sounds really simple, but what is the best way accomplish this? 

Can I somehow make a filter or slicer that does this for me? Should I use calculatetable(filter())? Should I just use calculate(filter()) separately on all rows? What would be the best practice?

Thank all of you once again!

  • Mariusz's avatar
    Mariusz
    6 years ago

    Hi GoingIncognito 

     

    You can use the below as a measure 

    Measure = SUMX( 'Table', INT( 'Table'[x] = 'Table'[y] ) )

     And use the Measure to filter Visual table like.

     

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

5 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi GoingIncognito 

     

    you can simply add a column in your 'Table' with syntax simple as.

    Column = Table[Date1] = Table[Date2]

    This will return true if the same and false if not, later you can use filter pane to filter page or visual to True

     

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

    • GoingIncognito's avatar
      GoingIncognito
      Icon for Advocate III rankAdvocate III

      Yeah, I though about this too. I don't especially like adding more columns to any table - but in this scenario it really seems like the best solution? Thank you for you advice!

      • Mariusz's avatar
        Mariusz
        Icon for Community Champion rankCommunity Champion

        Hi GoingIncognito 

         

        You can use the below as a measure 

        Measure = SUMX( 'Table', INT( 'Table'[x] = 'Table'[y] ) )

         And use the Measure to filter Visual table like.

         

         

        Best Regards,
        Mariusz

        If this post helps, then please consider Accepting it as the solution.

        Please feel free to connect with me.
        LinkedIn

         

  • Oh, yeah I forgot to mention: Table1[Date2] has the same date repeated on all rows. So I can't just filter out the rows that has blanks. I need to compare the two dates.