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
chahineatallah
Helper III
Helper III

calculate function

Hello, i have a question

as i know calculate will over ride any filter in context, so why am getting blank values, why it is not showing same values everywhere, thanks

 

question.png

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @chahineatallah 

 

I'd like to suggest you use 'ALL(Table)' or 'ALLSELECTED(Table)' in 'Filter'. I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

i1.png

 

You may create a measure like below.

Result = 
CALCULATE(
    SUM('Table'[Value]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Class]="c1"
    )
)

 

Result:

i2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @chahineatallah 

 

I'd like to suggest you use 'ALL(Table)' or 'ALLSELECTED(Table)' in 'Filter'. I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

i1.png

 

You may create a measure like below.

Result = 
CALCULATE(
    SUM('Table'[Value]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Class]="c1"
    )
)

 

Result:

i2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

timg
Solution Sage
Solution Sage

Hi,

This is because you are using the FILTER() function as well. With this function you limit the calculation of quantity sold to only "portland". If you leave out the FILTER() it will calculate the portland quantity for all rows. example:

SalesExample = CALCULATE([Revenue], DimReseller[Reseller] = "a bike store")

1.PNG 

Hope that clarifies!

Best regards,

Tim





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@chahineatallah , for same value remove filter and try measure like

 

calculate([quantity sold] , region[sales_..] ="Portland")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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 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.

Top Solution Authors