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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Py0809
Frequent Visitor

Filter two columns together

I have a fact table in PBI as below:

Py0809_1-1706177392704.png

I have the dimension tables linked to the fact table for all the region, subregion and site as well:

Py0809_3-1706177497606.png

If I choose the slicer "Region" = "AMER",

The matrix visual only able to show "AMER" details for "From Region" while it could not show those details with "AMER" in "To Region" as shown table below:

Py0809_4-1706178066390.png

My expected output should be:

Py0809_5-1706178150846.png

The same issues go to Site & Subregion as well. How can I get my expected output as shown above?

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Py0809 ,

I updated my sample pbix file(see the attachment), please find the details in it.

1. Create the measures as below

Region Flag = 
VAR _fregion =
    SELECTEDVALUE ( 'Fact'[From Region] )
VAR _tregion =
    SELECTEDVALUE ( 'Fact'[To Region] )
VAR _regions =
    ALLSELECTED ( 'Dim_Region'[Region] )
RETURN
    IF (
        HASONEFILTER ( Dim_Region[Region] ),
        IF ( _fregion IN _regions || _tregion IN _regions, 1, 0 ),
        1
    )
Subregion Flag = 
VAR _fsregion =
    SELECTEDVALUE ( 'Fact'[From Subregion] )
VAR _tsregion =
    SELECTEDVALUE ( 'Fact'[To Subregion] )
VAR _subregions =
    ALLSELECTED ( 'Dim_Subregion'[Subregion] )
RETURN
    IF (
        HASONEFILTER ( Dim_Subregion[Subregion] ),
        IF ( _fsregion IN _subregions || _tsregion IN _subregions, 1, 0 ),
        1
    )
Site Flag = 
VAR _fsite =
    SELECTEDVALUE ( 'Fact'[From Site] )
VAR _tsite =
    SELECTEDVALUE ( 'Fact'[To Site] )
VAR _sites =
    ALLSELECTED ( 'Dim_Site'[Site] )
RETURN
    IF (
        HASONEFILTER ( 'Dim_Site'[Site] ),
        IF ( _fsite IN _sites || _tsite IN _sites, 1, 0 ),
        1
    )

2. Create the visual and apply the visual-level filter with the condition (Region Flag is 1, Subregion Flag is 1 and Site is 1)

vyiruanmsft_0-1706679533960.png

Best Regards

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Py0809 ,

I created a sample pbix file(see the attachment), please find the details in it.

Region Flag = 
VAR _fregion =
    SELECTEDVALUE ( 'Fact'[From Region] )
VAR _tregion =
    SELECTEDVALUE ( 'Fact'[To Region] )
VAR _regions =
    ALLSELECTED ( 'Dim_Region'[Region] )
RETURN
    IF (  _fregion IN _regions || _tregion IN _regions , 1, 0 )

vyiruanmsft_0-1706522171141.png

Best Regards

But when I try to filter Site = "WISCHE", the table does not apply the filter and still showing other site (COMKUN) as well. Is there any solution for this?

Py0809_0-1706614813824.png

 

Anonymous
Not applicable

Hi @Py0809 ,

I updated my sample pbix file(see the attachment), please find the details in it.

1. Create the measures as below

Region Flag = 
VAR _fregion =
    SELECTEDVALUE ( 'Fact'[From Region] )
VAR _tregion =
    SELECTEDVALUE ( 'Fact'[To Region] )
VAR _regions =
    ALLSELECTED ( 'Dim_Region'[Region] )
RETURN
    IF (
        HASONEFILTER ( Dim_Region[Region] ),
        IF ( _fregion IN _regions || _tregion IN _regions, 1, 0 ),
        1
    )
Subregion Flag = 
VAR _fsregion =
    SELECTEDVALUE ( 'Fact'[From Subregion] )
VAR _tsregion =
    SELECTEDVALUE ( 'Fact'[To Subregion] )
VAR _subregions =
    ALLSELECTED ( 'Dim_Subregion'[Subregion] )
RETURN
    IF (
        HASONEFILTER ( Dim_Subregion[Subregion] ),
        IF ( _fsregion IN _subregions || _tsregion IN _subregions, 1, 0 ),
        1
    )
Site Flag = 
VAR _fsite =
    SELECTEDVALUE ( 'Fact'[From Site] )
VAR _tsite =
    SELECTEDVALUE ( 'Fact'[To Site] )
VAR _sites =
    ALLSELECTED ( 'Dim_Site'[Site] )
RETURN
    IF (
        HASONEFILTER ( 'Dim_Site'[Site] ),
        IF ( _fsite IN _sites || _tsite IN _sites, 1, 0 ),
        1
    )

2. Create the visual and apply the visual-level filter with the condition (Region Flag is 1, Subregion Flag is 1 and Site is 1)

vyiruanmsft_0-1706679533960.png

Best Regards

scottostanek
Frequent Visitor

Can you make a new column to combine From Region and To Region and filter on contains "AMER" ? This adds in complexity. You either have to hard code the options or set up a formula to return "AMER" if from or two contain it, which leaves out the idea you may also want to do the same for "EMEAF" in the same filter. Unless each item in the "filter" box were 5 separate radio buttons for the regions, with each testing for contained in the combined field.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.