Forum Discussion

MikhailGG's avatar
MikhailGG
Icon for Helper I rankHelper I
1 year ago
Solved

Using values to compare from 2 tables in DAX Filter

How to use 2 different tables in filter expression?

 

CALCULATE (VALUES ( 'Benchmark Categories'[Categories]), Table[Value]>='Benchmark Categories'[Lower_Level], Table[Value]<'Benchmark Categories'[Upper_Level])
doesn't work.
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi MikhailGG ,

    Here is my sample data:

     

    You can use this DAX to create a calculated table in table Benchmark Categories

    Dog_ID_Count = 
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(
            'Table',
            'Table'[Value] >= 'Benchmark Categories'[Lower_Level] &&
            'Table'[Value] <= 'Benchmark Categories'[Upper_Level]
        )
    )

    And the final output is as below:

     

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

6 Replies

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

      Hi FreemanZ 

       

      There is no relationship between the tables. Benchmark Categories is customly created.

      • FreemanZ's avatar
        FreemanZ
        Icon for Super User rankSuper User

        hi MikhailGG ,

         

        what filter context do you have for the needed measure? Or how do you plan to visualise the measure?