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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Vincem35
Helper I
Helper I

Exclude a Filter in a Calculated Table

Dear Community, 


I am working with a transaction table and would like to count the number of product categories a client purchase within a time frame.
results below are correct 

Vincem35_1-1606097558925.png

In the same page as this measure, i also have a bar chart displaying all the product category - see below

Vincem35_0-1606097525549.png

 

The issue i face is when i click on one product category - naturally the filter is propagated in the all table, as a result, i am getting 100% in Mono-Category although some clients have purchased this product category with another one

Vincem35_2-1606097660765.png

 

Below is my DAX

Thanks for your help!

 

Multi_Cat by clients = 
var Min_Date = [First Date Period TY]-- ie 2019-01-01
Var Max_Date = [End Date Period TY] -- ie 2019-12-31
Var Multi_Cat = values('Multi-Categories'[Column1]) -– Values from 1 to 4

VAR Customers_List =
    CALCULATETABLE (                        
        SUMMARIZE(' POS Boutique Transactions',' POS Boutique Transactions'[CLIENT_ID]),
        filter(' POS Boutique Transactions', ' POS Boutique Transactions'[DT_DOCUMENT]>= Min_Date && ' POS Boutique Transactions'[DT_DOCUMENT] <= Max_Date),
        filter(' POS Boutique Transactions', ' POS Boutique Transactions'[DT_VALID_TO] > Max_Date),
        ' POS Boutique Transactions'[SALESFORCE]= TRUE())

Var Table_Temp = 
        CALCULATETABLE(
        SUMMARIZE(' POS Boutique Transactions', ' POS Boutique Transactions'[CLIENT_ID],
        "Multi-Cat", DISTINCTCOUNT(' POS Boutique Transactions'[Product Category])),
        TREATAS (Customers_List,' POS Boutique Transactions'[CLIENT_ID]),
        filter(' POS Boutique Transactions', ' POS Boutique Transactions'[DT_DOCUMENT]>= Min_Date && ' POS Boutique Transactions'[DT_DOCUMENT] <= Max_Date),
        filter(' POS Boutique Transactions', ' POS Boutique Transactions'[DT_VALID_TO] > Max_Date))

Var Calc = 
    if(Multi_Cat = 1,
    CALCULATE(DISTINCTCOUNT(' POS Boutique Transactions'[CLIENT_ID]),
    filter(Table_Temp, [Multi-Cat] =Multi_Cat)),
    CALCULATE(DISTINCTCOUNT(' POS Boutique Transactions'[CLIENT_ID]),
    filter(Table_Temp, [Multi-Cat] >=Multi_Cat)))
    
Var Test = if(isblank(calc), 0, calc)
RETURN Test

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Vincem35,

As mahoneypat said, you can use the 'edit interaction' panel to ignore the external filter effect to break the current visualization graph.

Since current Dax formulas not able to extract multiple values from the slicer and filters who used the same data source table field. So if you want to keep the filter effect and ignore a specific filter, you can try to create a calculated table to duplicate the raw table field that you used on the filter. Then you can add conditions into the DAX expressions to compare with both two filter selections.

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Vincem35,

As mahoneypat said, you can use the 'edit interaction' panel to ignore the external filter effect to break the current visualization graph.

Since current Dax formulas not able to extract multiple values from the slicer and filters who used the same data source table field. So if you want to keep the filter effect and ignore a specific filter, you can try to create a calculated table to duplicate the raw table field that you used on the filter. Then you can add conditions into the DAX expressions to compare with both two filter selections.

Regards,

Xiaoxin Sheng

mahoneypat
Microsoft Employee
Microsoft Employee

Have you already used the edit interactions feature to prevent the undesired cross filter behavior?

Change how visuals interact in a report - Power BI | Microsoft Docs

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.