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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
dhrubojtg
Frequent Visitor

Power BI Filtering a column vs Filtering a table when is the difference apparent and when not

Power BI Filtering a column vs Filtering a table when is the difference apparent and when not
Can some expert help me to make this clear in context to this example from DAX Definitive guide 2nd edition by Alberto Ferrari Chapter 14 ( Unfortunately I am not able to understand the explanation there even after sequential reading)


To explain my confusion ; I am clear (may be not aware of some nuance ) about dax expanded table which expands towards one side of the table in m-1 or 1-1 relationship { So if you just reply me with expanded table as reasone it would still not help me here to be frank , unless you can please help me with any nuance if exists )

 

PBIX : Contoso public data model for microsoft

QUESTION :

1.I am not getting why in Case 2 -FilterTabMeasure equal to FilterTab  ?

1a.
I am not getting why splitting into the individual measure and trying to make the same gui report as in case 1 makes the result vary.

2.I am not getting why in Case 1 -FilterCol not equal to FilterTab  ?

2a.
Further Why filter tab value is the same for  all the rows ; Why context transition is being ignored here for FilterTab but respected for FilterCol ?


Case 1 : Apply this expression directly
--------------------------------------------
EVALUATE
ADDCOLUMNS (
VALUES ( 'Product'[Brand] ),
"FilterCol", CALCULATE (
[Sales Amount],
Sales[Quantity] > 1
),
"FilterTab", CALCULATE (
[Sales Amount],
FILTER (
Sales,
Sales[Quantity] > 1
)
)
)

Side note : [Sales amount is a measure as defined below]

Sales Amount = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )


--------------------------------------------------------
Case 2 :
Split the above expression into two masure

FilterColMeasure = CALCULATE (
[Sales Amount],
Sales[Quantity] > 1)
-------------
FilterTabMeasure = CALCULATE (
[Sales Amount],
FILTER (
Sales,
Sales[Quantity] > 1))

Side note : [Sales amount is a measure as defined below]

Sales Amount = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )
Now-;
Pull a table, pull values as the Product brand, and above two filters.

-------------------------------------------------------------------------------------------
              CASE 1                       CASE-2

dhrubojtg_0-1618114262922.png

 

 

 




 

6 REPLIES 6
dhrubojtg
Frequent Visitor

@amitchandak  If you can please help on above understanding .Thank you

dhrubojtg
Frequent Visitor

@Anonymous  Please comment if you have some time .Thanks

In Case 2 you get what you get because there is no context transition for the measures as was in the case of ADDCOLUMNS. The filters are already in place when the measures get down to work.

I forgot to mention sales amount measure defination i have updated in qn does your answer still hold good

Your Case 1 can be written as:

 

EVALUATE
ADDCOLUMNS(
    VALUES( 'Product'[Brand] ),
    "FilterCol",
        CALCULATE(
            [Sales Amount],
            FILTER(
                ALL( Sales[Quantity] ), -- this only filters one column
                Sales[Quantity] > 1
            )
        ),
    "FilterTab",
        CALCULATE(
            [Sales Amount],
            FILTER(
                Sales, -- this filters all the table BEFORE context transition
                Sales[Quantity] > 1
            )
        )
)

 

Now, do you see the difference?

@daxer-almighty 

I forgot to mention sales amount measure defination i have updated in qn does your answer still hold good

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.