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

How to have one option in a filter to select all values

So I have a dataset of accounts and each account is within a region, I also have an associated file that has the following regional structure of APAC, Americas, Europe and Intl. Anything that has an Intl region tag applies to all of APAC, americas and europe, what I want is when I filter on say APAC it filters to show both APAC and Intl for both the account file and the associated file, and if you filter on Intl it displays all values.

 

I am currently using a region filter table to link the two tables and I have tried to implement region encoding on this table on the different regions but I havent been able to execute it correctly.

 

Thanks for your help.

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Based on my assumption, I created two sample tables: Accounts table and Regions table

1.PNG  2.PNG

 

Please create a calculated table with below formula:

Regions table_1 =
UNION (
    'Regions table',
    ADDCOLUMNS (
        CALCULATETABLE (
            VALUES ( 'Regions table'[AccountID] ),
            FILTER ( 'Regions table', 'Regions table'[Region] <> "Intl" )
        ),
        "Regional", "Intl"
    ),
    CROSSJOIN (
        CALCULATETABLE (
            VALUES ( 'Regions table'[AccountID] ),
            FILTER ( 'Regions table', 'Regions table'[Region] = "Intl" )
        ),
        CALCULATETABLE (
            VALUES ( 'Regions table'[Region] ),
            FILTER ( 'Regions table', 'Regions table'[Region] <> "Intl" )
        )
    )
)

 

Also, you need to add a calculated column in above table:

Region in origina table =
LOOKUPVALUE (
    'Regions table'[Region],
    'Regions table'[AccountID], 'Regions table_1'[AccountID]
)

Then, you will get below result.

4.PNG

 

Establish a one to many relationship from 'Accounts table' to 'Regions table_1'.

3.PNG

 

Add 'Regions table_1'[Region] into slicer. Drag corresponding fields from 'Regions table_1' and 'Accounts table' into table visual.

5.PNG6.PNG

 

Best regards,

Yuliana Gu

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

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Based on my assumption, I created two sample tables: Accounts table and Regions table

1.PNG  2.PNG

 

Please create a calculated table with below formula:

Regions table_1 =
UNION (
    'Regions table',
    ADDCOLUMNS (
        CALCULATETABLE (
            VALUES ( 'Regions table'[AccountID] ),
            FILTER ( 'Regions table', 'Regions table'[Region] <> "Intl" )
        ),
        "Regional", "Intl"
    ),
    CROSSJOIN (
        CALCULATETABLE (
            VALUES ( 'Regions table'[AccountID] ),
            FILTER ( 'Regions table', 'Regions table'[Region] = "Intl" )
        ),
        CALCULATETABLE (
            VALUES ( 'Regions table'[Region] ),
            FILTER ( 'Regions table', 'Regions table'[Region] <> "Intl" )
        )
    )
)

 

Also, you need to add a calculated column in above table:

Region in origina table =
LOOKUPVALUE (
    'Regions table'[Region],
    'Regions table'[AccountID], 'Regions table_1'[AccountID]
)

Then, you will get below result.

4.PNG

 

Establish a one to many relationship from 'Accounts table' to 'Regions table_1'.

3.PNG

 

Add 'Regions table_1'[Region] into slicer. Drag corresponding fields from 'Regions table_1' and 'Accounts table' into table visual.

5.PNG6.PNG

 

Best regards,

Yuliana Gu

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

That looks like exactly what I was looking for thank you!

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.