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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
markovuc
Regular Visitor

What this code actailly do?

I dont understand what do code Grand Total= Calculate([Total obtained marks], ALL (Marks[Subject])) ? Please check screen shot. Calculate removes filters in visual and I dont understand what ALL do. It removes the same filter as calculate subjects???534548.jpg

1 ACCEPTED SOLUTION

@markovuc 

Imagine you have a formula to calculate the total marks obtained, and it takes into account different subjects. Now, if you use the CALCULATE function with ALL(Marks[Subject]) as an argument, it's like telling the formula to ignore the influence of the subject filter. So, on each row, you get the total marks without being influenced by the specific subject, giving you a broader picture across all subjects.


Hope that clarifies it! If you have any specific questions or need more examples, feel free to ask.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@markovuc 

In your formula, Caculate is used to modify how your measure [Total obtained marks] is evaluated. By applying ALL (Marks[Subject]) as an argument to the Calculate functon, it removes the filter coming from Subject column, that is the reason on each row, you see the total amount where [Total obtained marks] is not affected by subject.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi guys, many thanks for your replies. Happy 2024.! I dont understand following sentence "In your formula, Caculate is used to modify how your measure [Total obtained marks] is evaluated."How the measure is evaluated with calculate and without ? 

I still dont understand what Calculate do? How Calculate operate. 

@markovuc 

Imagine you have a formula to calculate the total marks obtained, and it takes into account different subjects. Now, if you use the CALCULATE function with ALL(Marks[Subject]) as an argument, it's like telling the formula to ignore the influence of the subject filter. So, on each row, you get the total marks without being influenced by the specific subject, giving you a broader picture across all subjects.


Hope that clarifies it! If you have any specific questions or need more examples, feel free to ask.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @markovuc ,

 

The formular calculates the Grand Total by using the [Total obtained marks] measure and removing the applied filter to Marks[Subject] (due to "ALL()" )

 

That is why your visual shows the same number for all subjects in the Grand total column. PBI applies a filter to each row of your table, namely where Marks[Subject] = "Bio" for row 1, Marks[Subject] = "Computer" for row 2 etc. Now the ALL() function makes your Grand Total measure disregard that exact filter and therefore it shows 355 for all rows whereas the filter for the other measure [Total obtained marks] is still being applied.

 

hope this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.