Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-cherch-msft
Employee
Employee

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

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

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

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... 🙂

 

Regards

 

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

Hello @v-cherch-msft

 

Getting there. 🙂

 

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

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.