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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Filter data error

Hi Everyone,

 

I created a measure as below
//filtering data = calculate([Total Quantity],'Region/Owner'[Region]="Europe") 
However, when i put the measure in a table im getting the below resultfilterdoubt.PNG

Why  is that all the quantity is reflecting same though my model is correct ? shouldnt it be 0 for other countries?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

It seems like the measure of  [Total Quantity] is incorrect... The correct one is as follows:

correct Total Quantity =
CALCULATE (
    SUM ( 'Region/Owner'[Quantity] ),
    FILTER (
        ALL ( 'Region/Owner' ),
        'Region/Owner'[Region] = MAX ( 'Region/Owner'[Region] )
    )
)

Or use :

Measure =
IF (
    MAX ( 'Region/Owner'[Region] ) = "Europe",
    CALCULATE (
        SUM ( 'Region/Owner'[Quantity] ),
        FILTER ( ALL ( 'Region/Owner' ), 'Region/Owner'[Region] = "Europe" )
    ),
    0
)

My visualization looks like this:

10.15.1.1.PNG

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

It seems like the measure of  [Total Quantity] is incorrect... The correct one is as follows:

correct Total Quantity =
CALCULATE (
    SUM ( 'Region/Owner'[Quantity] ),
    FILTER (
        ALL ( 'Region/Owner' ),
        'Region/Owner'[Region] = MAX ( 'Region/Owner'[Region] )
    )
)

Or use :

Measure =
IF (
    MAX ( 'Region/Owner'[Region] ) = "Europe",
    CALCULATE (
        SUM ( 'Region/Owner'[Quantity] ),
        FILTER ( ALL ( 'Region/Owner' ), 'Region/Owner'[Region] = "Europe" )
    ),
    0
)

My visualization looks like this:

10.15.1.1.PNG

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

@Anonymous - You can use below-

 filtering data = calculate([Total Quantity],FILTER('Region/Owner','Region/Owner'[Region]="Europe") )

 

Appreciate your kudos!! Mark my post as solution if this helps.

Anonymous
Not applicable

@Anonymous can you explain why the filter didnt work which is inbuilt in calculate function?

Anonymous
Not applicable

@Anonymous -

If you take a look at the below snap which shows the syntax for CALCULATE function-

Filter.PNG

Filter is not inbuilt in CALCULATE, we need to pass the filter condition to return the desired table and that we can do by using FILTER function.

 

Appreciate your kudos!! Mark my post as solution if this helps.

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.