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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Brett007
Helper III
Helper III

Filter Results without reducing the values in the column

I would like to filter results to show all locations with Product Line A and show all of the other Product Lines produced in that location.

 

Brett007_0-1613687482720.png

 

This is the bad result

Brett007_0-1613687658991.png

 

I would like to see the other Product Lines made in those locations at the same time.

 

This is the Measure that I use to generate the "List of Product Line values" column

Brett007_1-1613687754718.png

Main table of values is 'allChart'

Brett007_2-1613687864739.png

 

 

Let me know if you have any ideas.

 

Thank you,

-Brett

 

 

 

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Brett007 

 

The solution I would suggest involves using ALL ( 'allChart'[Product Line] ) to clear the filter on Product Line when determining the list of Product Line values

 

In the code below, ValuesComplete is a list of Product Lines with the Product Line filter cleared.

 

I also rewrote the code slightly, using the fact to TOPN will return all the values if there are fewer than N.

 

Does this work as expected?

 

List of Product Line values = 
VAR __MAX_VALUES_TO_SHOW = 100
VAR ValuesComplete =
    CALCULATETABLE (
        VALUES ( 'allChart'[Product Line] ),
        ALL ( 'allChart'[Product Line] )
    )
VAR __DISTINCT_VALUES_COUNT =
    COUNTROWS ( ValuesComplete )
VAR DisplayEtc =
    __DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW
VAR Result =
    CONCATENATEX (
        -- TopN can be used even if num items is smaller than max
        TOPN (
            __MAX_VALUES_TO_SHOW,
            ValuesComplete,
            'allChart'[Product Line], ASC
        ),
        'allChart'[Product Line],
        ", ",
        'allChart'[Product Line], ASC
    )
        & IF (
            DisplayEtc,
            ", etc."
        )
RETURN
    Result

 

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @Brett007 

 

The solution I would suggest involves using ALL ( 'allChart'[Product Line] ) to clear the filter on Product Line when determining the list of Product Line values

 

In the code below, ValuesComplete is a list of Product Lines with the Product Line filter cleared.

 

I also rewrote the code slightly, using the fact to TOPN will return all the values if there are fewer than N.

 

Does this work as expected?

 

List of Product Line values = 
VAR __MAX_VALUES_TO_SHOW = 100
VAR ValuesComplete =
    CALCULATETABLE (
        VALUES ( 'allChart'[Product Line] ),
        ALL ( 'allChart'[Product Line] )
    )
VAR __DISTINCT_VALUES_COUNT =
    COUNTROWS ( ValuesComplete )
VAR DisplayEtc =
    __DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW
VAR Result =
    CONCATENATEX (
        -- TopN can be used even if num items is smaller than max
        TOPN (
            __MAX_VALUES_TO_SHOW,
            ValuesComplete,
            'allChart'[Product Line], ASC
        ),
        'allChart'[Product Line],
        ", ",
        'allChart'[Product Line], ASC
    )
        & IF (
            DisplayEtc,
            ", etc."
        )
RETURN
    Result

 

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Works perfectly.  Thank you.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors