Reader small image

You're reading from  The Complete Power BI Interview Guide

Product typeBook
Published inApr 2024
Reading LevelIntermediate
PublisherPackt
ISBN-139781805120674
Edition1st Edition
Languages
Right arrow
Authors (3):
Sandielly Ortega Polanco
Sandielly Ortega Polanco
author image
Sandielly Ortega Polanco

Sandielly Ortega is a data enthusiast and Business Intelligence advocate, he combines programming expertise with Power BI proficiency to drive data-driven decision-making. With over 8 years of experience, he empowers businesses in various sectors, including hospitality and supply chain. Sandielly is also a content creator on YouTube, a speaker, and resides in Puerto Plata, Dominican Republic, with his family.
Read more about Sandielly Ortega Polanco

Gogula Aryalingam
Gogula Aryalingam
author image
Gogula Aryalingam

Gogula Aryalingam has 18+ years of global experience in data analytics and business intelligence, Gogula is a data & AI architect at Fortude. He holds multiple Microsoft MVP awards and certifications, contributing significantly to the development of database and analytics certifications for Microsoft. Gogula is also an author and technical writer for various publications.
Read more about Gogula Aryalingam

Abu Bakar Nisar Alvi
Abu Bakar Nisar Alvi
author image
Abu Bakar Nisar Alvi

Abu Bakar N. Alvi is a seasoned Product Manager and Project Management Professional with 23+ years of industry experience, Abu Bakar excels in leading cross-functional teams. Holding degrees in Computer Engineering and Satellite Communications, he's a Senior Digital Consultant and Microsoft Certified Trainer. Abu Bakar has earned global certifications, including recognition from the Government of Pakistan.
Read more about Abu Bakar Nisar Alvi

View More author details
Right arrow

Understanding evaluation contexts

In the previous section, we used the SUMX function to sum the result of multiplying price by quantity. Similarly, we achieved the same result by creating a calculated column without the need to use the SUMX function.

Measures

The following code refers to a measure:

SUMX TEST = SUMX (
    Products,
    Products[Price] * Products[Qty]
    )

Calculated column

The following code refers to a calculated column:

Total = Products[Price] * Products[Qty]

The fact that both calculations return the same result is related to the execution environment, specifically the evaluation context in which they are executed.

A simple example to understand this concept is by adding the measure to a card in your report. As you can see, the result is the total sum of each multiplication of price by quantity. This is essentially the total sales as we have renamed the measure:

Figure 7.9: A card visual with a measure added ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The Complete Power BI Interview Guide
Published in: Apr 2024Publisher: PacktISBN-13: 9781805120674

Authors (3)

author image
Sandielly Ortega Polanco

Sandielly Ortega is a data enthusiast and Business Intelligence advocate, he combines programming expertise with Power BI proficiency to drive data-driven decision-making. With over 8 years of experience, he empowers businesses in various sectors, including hospitality and supply chain. Sandielly is also a content creator on YouTube, a speaker, and resides in Puerto Plata, Dominican Republic, with his family.
Read more about Sandielly Ortega Polanco

author image
Gogula Aryalingam

Gogula Aryalingam has 18+ years of global experience in data analytics and business intelligence, Gogula is a data & AI architect at Fortude. He holds multiple Microsoft MVP awards and certifications, contributing significantly to the development of database and analytics certifications for Microsoft. Gogula is also an author and technical writer for various publications.
Read more about Gogula Aryalingam

author image
Abu Bakar Nisar Alvi

Abu Bakar N. Alvi is a seasoned Product Manager and Project Management Professional with 23+ years of industry experience, Abu Bakar excels in leading cross-functional teams. Holding degrees in Computer Engineering and Satellite Communications, he's a Senior Digital Consultant and Microsoft Certified Trainer. Abu Bakar has earned global certifications, including recognition from the Government of Pakistan.
Read more about Abu Bakar Nisar Alvi