cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filtering using the same table as base

Hello To all

 

I'm trying to show in a report info that should be filter by two values that are in the same table, if I do it as it is I get zero results (which is correct).

 

How can I do this?

 

My table A is:

wid  value

1       2

2       8

3       3

4       5

5       1

 

Table B

id wid value type
1   1     2        1

2   1     4        2

3   2     5        1

4   3     3        1

5   3     9        2

6   4     8        1

 

They are linked by wid

 

and I what to have the possibility to shoe the values filter by type.

if I use type 1 in one filter and type 2 on the other

it should dispay the wid 1 and values 2 and 4.

 

Should I make auxiliary tables for each type but dinamic ones?

 

Thanks

7 REPLIES 7
Community Support Team
Community Support Team

Re: Filtering using the same table as base

Hi @Anonymous

 

It seems it's better to make auxiliary tables .

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Filtering using the same table as base

Hello @v-cherch-msft


Just did. I breaked the table B in two

 

Table B1

id wid value type
1   1     2        1

3   2     5        1

4   3     3        1

6   4     8        1

 

Table B2

id wid value type

2   1     4        2

5   3     9        2

 

by using FILTER with type.

 

But now if I link them to table A will I not get the same result? Or am I beeing a newbie.

 

Thanks

Community Support Team
Community Support Team

Re: Filtering using the same table as base

Hi @Anonymous

 

I reviewed your question and I think i cannot fully understand it. Why not use wid column in TableB as slicer to get it as below picture? Using type columns as slicers seems more complicated.

2.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Filtering using the same table as base

Hello @v-cherch-msft

 

I cannot use wid because in fact what I need to display is the value of Table A filter by both types.

 

I need to get the wid that as both type 1 and type 2 and use that to get the value of Table A.

 

In SQL seems more easy... Smiley Happy

 

Regards

 

Community Support Team
Community Support Team

Re: Filtering using the same table as base

Hi @Anonymous

 

Check below picture if it matches your request. Add two slicers and add a measure for Table A. Here is the sample file.

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Filtering using the same table as base

Hello @v-cherch-msft

 

Getting there. Smiley Happy

 

But now (and I believe is due to the measure) I'm not getting the desired results because I have more that type 1 and 2. Can this be the case?

 

Still digging the formulas but not yet arrived to the problem.

 

Regards

 

Community Support Team
Community Support Team

Re: Filtering using the same table as base

Hi @Anonymous

 

Just check your relationship and use 'Both' as cross filter direction. Then try below measure. It would be better to show more about your data sample for me to check it.

Measure =
IF (
    COUNTX (
        VALUES ( TableB[type] ),
        IF (
            SELECTEDVALUE ( SlicerA[type] ) = MAX ( TableB[type] )
                || SELECTEDVALUE ( SlicerB[type] ) = MAX ( TableB[type] ),
            1
        )
    )
        >= 2,
    1
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.