How to Use the CALCULATE Function in Power BI

Поділитися
Вставка
  • Опубліковано 21 січ 2025

КОМЕНТАРІ • 152

  • @TheGoodLifePH
    @TheGoodLifePH 4 роки тому +7

    Thanks. Just the kind of video training i wanted. Pls continue to create this type of videos. If i may request pls create one for auto refreshing the reports. What ways can we do that especially without using dedicated servers. Thanks

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Ed D Excellent! Tanks for your suggestions and keep up the great work!

  • @sonoftoid8702
    @sonoftoid8702 2 роки тому +1

    Very well done. This video shows you how to drive the CALCULATE car without trying to take you under the hood at the same time. Thanks

  • @doriginal69
    @doriginal69 10 місяців тому

    I know how to use this function, but this tutorial taught me exactly how I would have liked someone to teach it to me. Awesome job. Most people just tell you how to do it, but putting in examples of when you would use it and variations is exemplary. Well done.

  • @andress37
    @andress37 9 днів тому

    I am so lucky to find your channel, I have learn a lot more!!!!!👏

  • @just_normal_indian_guy
    @just_normal_indian_guy 3 роки тому +1

    I have searched for many videos and after that i have found your video.
    Exact to the point. Thanks man for your help.
    Appreciate your efforts.

  • @happyimhealthy
    @happyimhealthy 2 роки тому

    Thank you for the most clear explanation I have watched. I immediately subscribed.

  • @benk8279
    @benk8279 3 роки тому

    The first time I understand the calculate function and the formatting of DAX! Thank you:-)!!

  • @mr.prasadyadav
    @mr.prasadyadav 3 роки тому

    Thank you Man, it's very clear cut to understand

  • @Deeps88
    @Deeps88 4 роки тому

    First time I have gone through sensible explanation on UA-cam about power BI. I am new to this tool and comparison you show by applying filter on excel and match the amount that was Awesomeness 👌Sir. THANK YOU PLS UPLOAD MORE video I WOULD tag your content on insta so that more people take most out of it.

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Appreciate your feedback, Excel with ADeep! Glad it was helpful. Keep it up!

  • @IvanCortinas_ES
    @IvanCortinas_ES 3 роки тому

    Superb video Nestor. The very best of CALCULATE. Thank you for your examples.

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Thanks for your support, Iván. Keep up the good work!👍

  • @sandraying5990
    @sandraying5990 3 роки тому

    Thank you so much ! My first DAX experience

  • @virgie1728
    @virgie1728 3 роки тому

    You are a good teacher.. sweet and simple, clear, and on point.. luv this👍💖💞

  • @zafariqbalsyed6109
    @zafariqbalsyed6109 3 роки тому

    Thank you vary much Mr Nestor Adrianzen this is vary helpfull and informative lession good luck

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Glad it was helpful! Keep up the good work, Zafar. Cheers!

  • @vicmath1005
    @vicmath1005 3 роки тому

    Thank you. Very helpful explanation of the concept.

  • @bhanund
    @bhanund 2 роки тому

    Awesome demo and explanation!

  • @kebincui
    @kebincui 3 роки тому

    Thanks Nestor. Very Clear Tutorial 👍👍👍

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Glad it was helpful! keep up the good work, Kebin Cui.

  • @irfanabbassi9202
    @irfanabbassi9202 3 роки тому

    Excellent explanation..thoroughly enjoyed the video...teaching is pure art...Great job

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      I appreciate your feedback, Irfan. Keep it up👍

  • @raghun2636
    @raghun2636 3 роки тому +1

    Hi Nestor..where do i find the claims data sample..can you please share?

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Raghu N, Thanks for stopping by. I usually share the content link in the video description. Here is the link for reference.
      drive.google.com/file/d/1E_lzwZcgLaiGuhcBG-_9lcIQ1H5JNmNO/view?usp=sharing

  • @smartshan4u
    @smartshan4u 3 роки тому

    Very well explained. Great thanks Nestor!

  • @waheedabbas2366
    @waheedabbas2366 3 роки тому

    one of the best ever explanation with a very good example, perfect, thanks you !!

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Glad it was helpful! Keep up the great work, Waheed. Cheers!

  • @shakibarad
    @shakibarad 2 роки тому

    You are the best. Thank you so much.

    • @NestorAdrianzen
      @NestorAdrianzen  2 роки тому

      Glad it helped and thanks for your support. Cheers!

  • @tinashechinyati6823
    @tinashechinyati6823 4 роки тому

    awesome demo on calculate function. enjoyed following through. Thanks

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +1

      Glad it was helpful. Keep it up, Tinashe! 👊

  • @indianpigeon3680
    @indianpigeon3680 3 роки тому

    Thanks Nestor for this excellent video. Please share some interview question which usually ask in interview. thanks

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Glad it was helpful, Indian Pigeon! I’ll keep in mind your suggestion. Thanks 🙏

  • @sravankumar1767
    @sravankumar1767 3 роки тому +1

    Can we use" In operator " for multiples cities apart from OR operator

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому +1

      Yes, you can also use "IN". See below as reference.
      FILTER(
      ALL(Claim[City]),
      Claim[City] in {"Nashville","Phoenix","Greenville"}
      )

    • @sravankumar1767
      @sravankumar1767 3 роки тому

      @@NestorAdrianzen Thank u very much

  • @123jamalq
    @123jamalq 4 роки тому

    You briefed calculate function very smooth way, thanks,

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Jamal Qamar, I appreciate the feedback. Keep up the great work👍

  • @bonnguyen5433
    @bonnguyen5433 3 роки тому

    Great video, easy to follow and understand Thank you for sharing your knowledge.

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Glad you found it helpful, Non Nguyen. Keep up the good work.👍

  • @jhamca10
    @jhamca10 2 роки тому

    What a explanation by you really it's ausume.

    • @NestorAdrianzen
      @NestorAdrianzen  2 роки тому

      Thanks for your support, Chandrashekhar! Keep it up!👍

  • @juancardenas84
    @juancardenas84 2 роки тому

    Hi! How could you sum columns of different tables?

    • @NestorAdrianzen
      @NestorAdrianzen  2 роки тому

      Juan, Thanks for your support. What you can do is to create relationships between tables and then create a measure to sum numeric fields from another table. I hope this helps. Cheers!

  • @mysticalpotato2110
    @mysticalpotato2110 3 роки тому

    As you have used All function in the Calculate Filter function, how are the filters working in the visuals?

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Vinayak, Thanks for stopping by. The ALL function will remove any filter available within a column or table.

  • @priyadarshinichettiar6750
    @priyadarshinichettiar6750 4 роки тому

    Thank you so much, I was searching for this query for a long time. Your videos are awesome. Looking forward to more such amazing videos from you. Thanks once again. :)

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      @Priyadarshini, Thanks for your kind words. Keep up the great work!

  • @kimmy3047
    @kimmy3047 Рік тому

    Hi I know that this might be a bit late commenting on an old video but how do I show
    still the whole Sales Table but a specific customer has a filter context based on a column?
    like say in your example
    Making a Table showing The Claim Costs of all the Cities
    but I want the claim cost under the city name "Knoxville" to be filtered by only the claim costs under the delivery company "FedEx"
    reflecting a table that has all the claim costs of each city but one of them is filtered

    • @NestorAdrianzen
      @NestorAdrianzen  Рік тому

      Kimmy, Thanks for stopping by. I think you are trying to add multiple filters to your calculation. The example below might help:
      Measure:=
      CALCULATE(
      [Total Claim Cost],
      Claim[City] = "Knoxville" && Claims[Delivery Company] = "FedEx"
      )

  • @NatureTravelDairies
    @NatureTravelDairies 3 роки тому

    Why can't I choose other data except the just created data(Total Claim Cost). Is it possible to select another data column as well?

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Sangy Jap. Thanks for stopping by. The first part of the calculate function should be any expression. For the example, we use a measure that adds all the claim cost. However, you can also add other type of measure/calculation. This must be an expression, it cannot be just a numeric column. I hope this solves your question.

  • @radhaglasti
    @radhaglasti 4 роки тому

    Cool man!!! You have simply demonstrated 👍

  • @alimatulrahim5226
    @alimatulrahim5226 4 роки тому

    you are good teacher sir...thanks..

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      I appreciate your feedback, Alimatul. Keep up the good work!

  • @davidjames3494
    @davidjames3494 3 роки тому

    Why did you not use && instead of || when selecting the 3 cities?

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Thanks for stopping by, David. The && is an AND operator and for the example, I wanted to use an OR operator. I could have used IN in the filter argument as well. For example:
      Claim[city] IN {"Nashville", "Phoenix", "Greenville"}

  • @mihirthakkar6902
    @mihirthakkar6902 3 роки тому

    very nicely made. Thanks

  • @EyiBillion
    @EyiBillion Рік тому

    Brillinat! Thank You

  • @simmisahay2518
    @simmisahay2518 4 роки тому

    Is calculate function always return single value like aggregate function ?

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Simmi, Thanks for checking the content. As far as I know, yes, the CALCULATE returns a single value. If you want to get a table, you might want to use CALCULATETABLE. Thanks!

  • @sravankumar1767
    @sravankumar1767 4 роки тому

    AWESOME, YOUR VIDEOS ARE AMAZING

  • @saivishwanathgoud
    @saivishwanathgoud 4 роки тому

    Awesome ! Thanks for the video and please keep sharing more 🙂.

  • @bidhanry9740
    @bidhanry9740 2 роки тому

    i have a question, can you please explain the way dax evaluates, like in the first eg we have CALCULATE( expression, FILTER(ALL(table, exp))), so which exprssion gets evaluate first, what it returns, how the result gets interpreted inside brackets. I hope u get it.

    • @NestorAdrianzen
      @NestorAdrianzen  2 роки тому +1

      Bidhan,
      Thanks for your question. CALCULATE computes the filter argument first and then the expression. For this example, the filter argument is a table that uses the FILTER function. The ALL function scans all the values in a specific column.
      I hope this helps!
      Cheers!

  • @AmitErandole
    @AmitErandole 2 роки тому

    The link to the downloadable file is broken. Could you fix it please?

    • @NestorAdrianzen
      @NestorAdrianzen  2 роки тому

      Amit, Thanks for letting me know. I just updated the link. Here you go! drive.google.com/file/d/1kASvVjUiWeGSkZPamop5omITg7OuQ8VB/view?usp=sharing

  • @ilikedigitallogic5059
    @ilikedigitallogic5059 3 роки тому

    This video is very good!!! and Thanks

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому +1

      Glad you liked it! Keep it up, I like Digital Logic.

  • @liladhardudhabale3227
    @liladhardudhabale3227 3 роки тому

    Nice Explanation

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Thanks for you support, Liladhar. Keep it up 🆙

  • @kusalamarasena3882
    @kusalamarasena3882 4 роки тому

    i write the below function to get total of the bank sector
    Bank sales = CALCULATE([sales],FILTER(Orders,Orders[Manger]="9BNK"))
    here i did not happen to use ALL function. but it worked. here [sales] is a measure.
    could you please explain this

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +3

      Kusal, Thanks for stopping by. We usually use ALL as a filter modifier to remove all filters from a column or table. Initially, if that table or column doesn't present any filters (usually used in a slicer), the result could be the same by using or not using the ALL function. I hope it helps.

    • @kusalamarasena3882
      @kusalamarasena3882 4 роки тому

      @@NestorAdrianzen got it.thanks

  • @centugurdag7776
    @centugurdag7776 Рік тому

    great content , but why it is difficult /impossible to download the data file ?

    • @NestorAdrianzen
      @NestorAdrianzen  Рік тому

      Thanks for stopping by. Sorry to hear that. You might want to refresh your browser.

  • @harshalpatel555
    @harshalpatel555 4 роки тому +1

    Thanks Nestor the video was very knowledgeable. I have one question, When i am drwing a date claim column to axis of stacked column chart .its not filtering according to dates. And also in the report section i am unable to get a date symbol before date claim as you have

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +1

      Harshal, Thanks for stopping by. I highly recommend to create a calendar table and create a relationship based on the date column with the Claims table. After that, use the date column from the calendar table as part of the axis of any chart that you are building. For your second question, you might want to go to the "DATA" section of your report, then "Column Tools" and select the right Date Type. I hope it helps. Cheers! This tutorial about CALENDAR tables might also help: ua-cam.com/video/IU_2rkTFrLY/v-deo.html

  • @pieterjdw
    @pieterjdw 3 роки тому

    Very informative, but why do you prefer the filter method on the ‘left’. Looks more complicated

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому +1

      Good question! I used the FILTER function to apply complex filter conditions. Also, this video was recorded in 2020 when the new CALCULATE filters feature wasn't available yet. You might want to check the following tutorial out to learn about this new feature. I hope it helps. Cheers! ua-cam.com/video/KDnkGraX5c8/v-deo.html

  • @FahriKerimov
    @FahriKerimov 4 роки тому

    I am new to Power BI, coming from long xls experience. What I dont understand is the usage of rows (Shift+Enter) while typing the DAX formulas. What is the purpose of splitting the code in rows and then tabbing? is it just esthetics? or there is functionality for that???

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Fah Kem, Thanks for stopping by. These are good questions. By doing so, we can improve readibility of the DAX code. Also, if we make mistakes, it is easier to find and fix them. I hope it helps! Cheers!

    • @FahriKerimov
      @FahriKerimov 4 роки тому

      ​ @Nestor Adrianzen Thanks Nestor for quick response. May I ask you a bit more. I assume the readibility for ourselves not the machines right?
      I kind of understand that mistakes are highlighted by red colod code on the right of the row, but why we need to use Tab then? I am tottally puzzled after seing at 12:20 of your tutorial paranthesis placed on different rows and on different tab positions, and I cannot think of a potential mistake for paranthesis that one could make.
      Hope you can help me with my doubts.

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Yeah. I see your point. In reality there is no standard to write DAX code in Power BI. However, when we create more complex formulas, it’s better not to write them in just one line, because sooner than later we will get lost. You might want to check the following website for reference. Cheers! www.daxformatter.com

  • @sudippandit1
    @sudippandit1 4 роки тому

    Awesome video! Can you please upload or link of datasets under this video??

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Sudip, Thanks for following our content. We usually share the link content in the video description of each tutorial. Here it is as well. Cheers! drive.google.com/file/d/1E_lzwZcgLaiGuhcBG-_9lcIQ1H5JNmNO/view?usp=sharing

  • @prateekganguly4119
    @prateekganguly4119 4 роки тому +1

    Could you please share this excel sheet

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Prateek, Thanks for following our content. Please see the link below for the files. You can also find the link in the video description for every lesson. drive.google.com/file/d/1E_lzwZcgLaiGuhcBG-_9lcIQ1H5JNmNO/view?usp=sharing

  • @anjim8507
    @anjim8507 4 роки тому

    Post more DAX videos, really helpfull to me

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +1

      Thanks for stopping by Anji! Keep up the good work!

    • @anjim8507
      @anjim8507 4 роки тому +1

      Your way of explanation, making notes and teaching by step by steps are awesome....

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Glad you found it helpful 👊

  • @islam48ify
    @islam48ify 4 роки тому +1

    Wow thanks sir

  • @raftersteve
    @raftersteve 4 роки тому

    thank you, I'm new to this and hope this video will end up being my power BI foundation using it to build financial statements. I've followed your steps using my data which is formatted by department, by month and and amount. In trying to filter for just Dept 1. I get the correct sum for that dept 1, however the Dept1's name is blank and every other department is listed with the Dept 1's cost. Using a matrix view. If I add additional departments using || Dept[DeptName] = "dept 2")) I get the aggregate total cost for both departments, this is then displayed as the total cost for each of my departments.
    Really need a suggestion on what I could be doing wrong.

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Steve, Thanks for stopping by. I'm not sure if followed the whole story here, but it seems that it's related to the "context filter" with the CALCULATE function. Remember that the logical operator || takes one option or the other. Whereas, for the logical operator &&, both options need to be correct. Also if you want to keep active some filters, perhaps this tutorial can help. Cheers! ua-cam.com/video/s_9TYgTRsXY/v-deo.html

  • @simmisahay2518
    @simmisahay2518 4 роки тому

    Excellent

  • @vikramsingh-ws2nn
    @vikramsingh-ws2nn 3 роки тому

    Hi Nestor, could you please help me as I am trying to get percentage month wise for leaver, but outcome is coming in descending order that is incorrect. I have three tables First is a transaction table(Base Data), second is a fact table with starter, leaver date and status(ALL Employee), last one is a calendar table which is having just date, month, year etc(calendar date Table). Fact tables are having relationship with transaction table. The DAX, which I wrote is leaver count from fact table and divide by total number of employees. But the answer is wrong.
    (Leaver Count =
    CALCULATE(COUNT('ALL Employee'[Leaver Info]),
    FILTER('ALL Employee','ALL Employee'[Leaver Info]="Leaver")))
    (HeadCount = DISTINCTCOUNT('Base data'[Employee Code]))

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому +1

      Vikram Singh, Thanks for stopping by. For percentage calculations, you might want to check the following tutorial out: ua-cam.com/video/9IdFq2aPxmY/v-deo.html. If you are getting the right results, but the order is incorrect, you will need to add a "month" # column to your calendar table. Then sort the date column (e.g., the date column that is part of the axis of your visual) by using the "Sort by column" option and select the new column #. Finally, sort by selecting ascending or descending from your visual. I hope it helps! Cheers!

    • @vikramsingh-ws2nn
      @vikramsingh-ws2nn 3 роки тому

      @@NestorAdrianzen Thank you so much for this help

  • @eswarsonu1115
    @eswarsonu1115 3 роки тому

    Hi , Need your help.
    I want to create a column with month name + number of days in a month. Number of days in a month should change when we select month and year from the filter. Some cases we have leap year in that February month should show 29 and like wise non leap year February month should show 28 days.
    Output should be in this way .
    Jan 31
    Feb 28
    Mar 31
    Apr 30
    When I select year as 2020 from filter output should be like this
    Jan 31
    Feb 29
    Mar 31
    Apr 30.
    Thanks in advance.

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Eswar Sonu, Thanks for taking a look at the content. My suggestion would be to create a Calendar table. The date column will have its own hierarchy [Year, Quarter, Month and Day] that you can use to filter any date. This tutorial will help you create a calendar table. I hope it helps. Cheers! ua-cam.com/video/IU_2rkTFrLY/v-deo.html

  • @iSlowMagic
    @iSlowMagic 3 роки тому

    was alsomost quitting power BI until i watched this video. i still have challenges on how to compare daily revenue figures against monthly targets

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      I appreciate your feedback, Justin. Keep up the good work. Cheers!

  • @mansijswarnkar2183
    @mansijswarnkar2183 2 роки тому

    tTHANK YOU !

  • @yourinternationalexperienc2332
    @yourinternationalexperienc2332 4 роки тому

    Great content! I just have a question - is it possible to have multiple calculations in one measure, based on different values? So for example, I may want to do a sum if city is Nashville, and a count if city is Phoenix. How do I apply this in one measure? Thank you!

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +4

      Your International Experience, Great question! Yes, it is possible. You might want to use a nested IF function to do so. See below an example:
      Measure =
      IF(
      VALUES(Claim[City]) ="Nashville", SUM(Claim[Claim Cost]),
      IF(VALUES(Claim[City])="Phoenix", COUNTROWS(Claim)
      )
      )

    • @yourinternationalexperienc2332
      @yourinternationalexperienc2332 4 роки тому +2

      Thank you very much for your prompt response!

  • @kostaszogo21
    @kostaszogo21 2 роки тому

    Great video as always !
    I have a question though: Is there a way to filter by using only part of the value and not the whole word? For example instead of finding the Cost for [City] ="Nashville", can we find the Cost for every [City] that contains the "*ville" somewhere in its name?

    • @NestorAdrianzen
      @NestorAdrianzen  2 роки тому

      Yes, you can! One of the filters of the CALCULATE function can be like the following:
      CONTAINSSTRING(Claim [City], "*ville")
      This tutorial will help: ua-cam.com/video/Y82DHwlxAkI/v-deo.html

  • @KalaiVanan_mskvanan
    @KalaiVanan_mskvanan 4 роки тому

    Brother kindly continue dax we are waiting

  • @DatawithHimanshu
    @DatawithHimanshu Рік тому

    Great

  • @sadinenim5360
    @sadinenim5360 3 роки тому

    Hi Nestor I have a small doubt why

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Thanks for stopping by, Sadineni! What is your doubt?

  • @gogo14882
    @gogo14882 3 роки тому

    great

  • @jays5219
    @jays5219 4 роки тому +2

    "And right here" is a good comment.

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Jay, I hope you are enjoying the content. Cheers!

  • @powerbinareal
    @powerbinareal 4 роки тому +1

    Obrigado pelo conteúdo! Pode me meu canal também? Sou do Brasil.

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Power BI na Real, Excellent! Keep up the good work.

  • @centugurdag7776
    @centugurdag7776 Рік тому

    sorry for my previous message, i got the file

  • @ashwinizare7183
    @ashwinizare7183 3 роки тому

    Vedio is not clear.

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Ashwini Zare, Thanks for your feedback. t. I got a new screen recording software about 2 weeks ago, so hopefully the new tutorials look more legible.