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
SantoshKumar
Employee
Employee

Filter the data on the Result View due to special request

Hi All,

I have a special request to filter on the result set and the data is as follows:

I have Area,Customer,ListType and Parent Table. Since i do not have an option to attach the pbi file, i am posting the data below.

 

ListType
Games1
Games2
International1
International2
International3
International4
Store1
Store2
Store3
Store4

 

Area
Area1
Area2
Area3

 

Customer
Customer1
Customer2
Customer3

 

ListTypeParentIdAreaCustomer
Games19NBLGGH1H2Area1Customer1
Games29NBLGGH1H3Area2Customer2
International19NBLGGH1H4Area3Customer3
International29NBLGGH1H5Area1Customer1
International39NBLGGH1H6Area2Customer2
International49NBLGGH1H7Area3Customer3
Store19NBLGGH1H8Area1Customer1
Store29NBLGGH1H9Area2Customer2
Store39NBLGGH1H10Area3Customer3
Store49NBLGGH1H11Area1Customer1
Games19NBLGGH1H12Area2Customer2
Games29NBLGGH1H13Area3Customer3
International19NBLGGH1H14Area1Customer1
International29NBLGGH1H15Area2Customer2
International39NBLGGH1H16Area3Customer3
International49NBLGGH1H17Area1Customer1
Store19NBLGGH1H18Area2Customer2
Store29NBLGGH1H19Area3Customer3
Store39NBLGGH1H20Area1Customer1
Store49NBLGGH1H21Area2Customer2

 

SantoshKumar_1-1674695497123.png

 

Above view is working as expected due to relationships between the tables but i have a request not to show few values even the selection is made.
below is an example of my request,
When i have selected Area1 and Customer1, i am able to see all the ListType available for it. here i want to exclude only International4 when i have selected Area1,Customer1 in the selection.


What i tried from my end was:
1. I tried to use SelectedValues and tried to return the data. i faced with error as return value has to use some aggregate function which would provide only single value instead of List of values (ListType table).

Please let me know in case i can achieve my requirement in any other ways.


Regards

Santosh

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @SantoshKumar ,

 

You can filter out International4 in the Filters.

10.png

But you'll find that if you don't choose, International4 won't show up.

vstephenmsft_1-1675151263539.png

If you only want to exclude International4 when selecting Area1 and Customer1, you can create a measure.

Measure = 
IF (
    ISFILTERED ( Area[Area] ) && ISFILTERED ( Customer[Customer] ),
    IF (
        SELECTEDVALUE ( Area[Area] ) = "Area1"
            && SELECTEDVALUE ( 'Customer'[Customer] ) = "Customer1"
            && MAX ( 'ListType'[ListType] ) <> "International4",
        1,
        0
    ),
    1
)

Put the measure into the visual-level filters and set up show items when the value is 1.

vstephenmsft_2-1675152048439.png

The fields of the table visual and slicers are then created as follows. Because the field references in the measure formula, the source of the fields in the table visual and slicers cannot be easily changed.

11.png

When your slicer does not select a value or another value, International4 is not filtered out.

vstephenmsft_3-1675152205135.png

vstephenmsft_4-1675152218544.png

 

Best Regards,

Stephen Tao

 

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-stephen-msft
Community Support
Community Support

Hi @SantoshKumar ,

 

You can filter out International4 in the Filters.

10.png

But you'll find that if you don't choose, International4 won't show up.

vstephenmsft_1-1675151263539.png

If you only want to exclude International4 when selecting Area1 and Customer1, you can create a measure.

Measure = 
IF (
    ISFILTERED ( Area[Area] ) && ISFILTERED ( Customer[Customer] ),
    IF (
        SELECTEDVALUE ( Area[Area] ) = "Area1"
            && SELECTEDVALUE ( 'Customer'[Customer] ) = "Customer1"
            && MAX ( 'ListType'[ListType] ) <> "International4",
        1,
        0
    ),
    1
)

Put the measure into the visual-level filters and set up show items when the value is 1.

vstephenmsft_2-1675152048439.png

The fields of the table visual and slicers are then created as follows. Because the field references in the measure formula, the source of the fields in the table visual and slicers cannot be easily changed.

11.png

When your slicer does not select a value or another value, International4 is not filtered out.

vstephenmsft_3-1675152205135.png

vstephenmsft_4-1675152218544.png

 

Best Regards,

Stephen Tao

 

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

@v-stephen-msft , thank you for taking time and providing inputs 
You solution is providing the solution to only one extent.
1. When i select Area1 and Customer1 then international4 is not showing up - Done
2. When any Customer is not selected then international4 is showing up - Done
3. when i select any other customer then table is showing as empty. - InComplete.
I want a measure so that when i select Area1 and Customer1 then international4 should be hide and for other selections, it should show other data as per tabe.
Ex: If add Internation4 for Area1 and for Customer2 and customer3 etc.

SantoshKumar_0-1675233759177.png

when i select Area1 and Customer2 then it should show international4 which at present not showing up.

SantoshKumar_1-1675233839856.png

Could you please provide any suggestion on it.
Regards

Santosh Kumar P

 





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.