• Skip to main content
  • Skip to footer

Curbal

Learn how to grow your business with your data and Power BI

  • Data Stories
    • Power BI Stories
    • 1 dataset, 100 matplotlib visualizations
  • Learning Portal
    • Download Center
    • 25 Days Challenge
    • DAX Glossary
    • Power BI
    • Power BI by Topic
    • Python
    • 1 dataset, 100 matplotlib visualizations
  • Courses
    • Power BI Mini Master Class 1: Using a REST API as a data source
    • Power BI Master Class 1: COVID Tracker
    • Introduction to Power BI – FREE Online course
    • M Language + Power Query Course Bundle
    • Power Query Online Training [updated 2022]
    • M Language Online Course: The unofficial and Practical Reference Guide [updated 2025]
    • My Courses
  • Shop
    • Courses
    • Master Classes
    • Template Apps
    • JSON Themes
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Search
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / CALCULATE

CALCULATE

posted on August 15, 2017

« Back to Glossary Index

Syntax

CALCULATE(<expression>,<filter1>,<filter2>…)

Tutorial with example

In this tutorial we go through in a series of videos through the function CALCULATE.

Calculate Part1:

DAX Fridays! #5: CALCULATE (Part 1)

Calculate Part 2:

DAX Fridays! #8: CALCULATE (Part 2)

Calculate Part 3: When you should use filter() function or a column in calculate.

DAX Fridays! #78: When should I use FILTER() with CALCULATE?

Download example file:

Download Power BI file (Part 1): here.

Download Power BI file (Part 2): here.

Download Power BI file (Part 3): here.

Common CALCULATE examples:

1. SUMIF, COUNTIF

CALCULATE is among other things, the function you would use instead of SUMIF or COUNTIF. In this video I will show you how to use CALCULATE as an equivalent of the excel functions SUMIF and COUNTIF.

DAX Fridays! #52: SUMIF, COUNTIF

Download example file:

No download file available for the sumif video. Please use the northwind dataset to practice.

2. RUNNING TOTALS, CUMULATIVE TOTALS

In this video I will show how to calculate running totals or also called cumulative totals using CALCULATE and FILTER:

DAX Fridays! #24: Running/ Cumulative totals (w Pareto chart)

Download example file:

Download Power BI file (Part 1): here.

Remarks

If the data has been filtered, the CALCULATE function changes the context in which the data is filtered, and evaluates the expression in the new context that you specify. For each column used in a filter argument, any existing filters on that column are removed, and the filter used in the filter argument is applied instead.

Was this helpful?
Related Articles:
  • 25 Days of DAX Fridays! Challenge
  • 25 Days of DAX Fridays! Challenge – Ed1: NorthWind Company
  • Google Analytics Template App by Curbal
  • The ”Bill Gates Effect” in Google Analytics and how to get rid of it with Power BI
  • The ultimate dashboard to track your website growth with Google Analytics 4 and Power BI
See Also:
  • ALLEXCEPT
  • AVERAGEX
  • CONFIDENCE.NORM
  • CONFIDENCE.T
  • CROSSFILTER
« Back to Index

Reader Interactions

Comments

  1. Antonio Rasco

    May 7, 2018 at 10:45 am

    Hi Ruth, do you have any video on difference between filter and calculatetable?

    KR

    Antonio

    Reply
    • Ruth Pozuelo Martinez

      May 8, 2018 at 10:53 am

      Hi Antonio,
      I just realized that I havent done calculatetable yet.
      I will do that first and then a comparison between calculatetable and filter.
      Thanks for the idea 🙂
      /Ruth

      Reply
  2. Kamal Mukhi

    May 6, 2018 at 12:25 pm

    Hi Ruth,

    Thank you for making DAX things easier to understand.
    I have one request. I checked the DAX Fridays’ video list and also the glossary section of curbal.com but couldn’t find the CALCULATETABLE function. Could you please explain that function?

    Thanks & Regards,
    Kamal Mukhi

    Reply
    • Ruth Pozuelo Martinez

      May 8, 2018 at 10:53 am

      Hi Kamal,
      That is true; I need to make that one. Is on my to-do list now 🙂
      /Ruth

      Reply
  3. Martin Loughman

    September 13, 2017 at 4:47 pm

    Hi Ruth, Good insights for me there in your two CALCULATE videos – thanks a lot! Just checking: For the 2nd video – would it be okay if I understood it as – you start with the filter coming from the row filter 1st. Then for FILTER as the second argument in CALCULATE, that this subsequent filtering only happens 2nd. So for example for “Gorgonzola Telino” it starts off with only this row filter so that’s why when you apply CALCULATE’s filter you get a sum for this one only. FILTER in this instance is only iterating over one row of the source table? For the next cheese “Gudbrandsdalsost” the 1st filter per the row results in the “Gudbrandsdalsost” row and the 2nd filter in CALCULATE would result in blank because that’s not “Gorgonzola Telino” or “Queso Cabrales”. Would it be okay to understand it as working that way?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer CTA

Join our community of +50,000 professionals

Become a Member

Subscribe to YouTube

About me:

Curbal AB
Badhusgatan 7B
722 15 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

© Copyright 2014-2025 · Curbal AB · All Rights Reserved · Privacy Policy · Terms of Service · Refund Policy · Log In