SlideShare a Scribd company logo
1 of 14
Power BI Tips
and Timesavers
Calculated Columns
And
Measures in Power BI
A guide to understanding the differences between calculated columns and
measures in DAX for Power BI
What is a calculated column?
A calculated column is a static value added to a table, calculated row by row when you load
the data.
What is a measure?
A measure is a dynamic value that changes based on what you’re looking at in a report,
calculated dynamically within the filter context of a visual
We will use a Gross Profit Example
We start by loading some sample sales data
How to create a calculated column
The first thing we will do is to calculate the Gross Profit for each row in this table
In the table view, select New Column from the Ribbon
How to create a calculated column
In the formula bar we type
Gross Profit = [Sales Value]-[Cost of Sales]
This adds a new column, which calculates the gross profit by subtracting the cost of sales from the sales value
When we press enter the column is added to the table, and it is calculated for each row of data in that table
We also create a Gross Profit Margin calculated column
Benefits & Limitations
Benefits of Calculated Columns in Power BI
One of the most obvious benefits of creating a calculated column in a table is that is easily visible and can be quickly
understood.
It is calculated once the data refreshes and is not affected by any other filters, effectively it is a static column. This means
that it can be used as a filter. In our example we could use a slicer to only show products that have a margin lower than
60%
Limitations of Calculated Columns in Power BI
Potentially the biggest draw back of calculated columns is that they must be calculated in full before the data table can be
used. This is usually not a problem if the data tables are small, but if you import a very large data table, then have complex
calculations running down a number of columns you will see a performance impact.
In that case it is often better to perform the calculation further back in the data transformation
How to create a measure
We want to create a measure that can calculate the overall gross profit margin, even if the report is filtered
To create the measure, go to the Table View, and click New Measure on the ribbon
Then copy and paste this DAX code
Gross Profit Margin (Measure) = sum(Sheet1[Gross Profit]) / sum(Sheet1[Sales Value])
When you press enter, the measure is created. But unlike the calculated column, it does not appear in the table view
Benefits of Measures in Power BI
Measures are only calculated where used and are only calculated in the context of the face value of the report, this way
they respond to filters and slicers
Limitations of Measures in Power BI
Measures can be more difficult to debug as they are more difficult to understand than a calculated column. But it can be
made simpler to understand by creating separate measures for elements of a complex calculation. For example in this
example we could create a measure for the sum of gross profit (the numerator) and check that. And we could also create a
measure for the sum of the Sales (the denominator) and check that. Out gross profit measure could then just be the
Numerator / the Denominator allowing us to debug the components separately
On the report view, drag a table to the canvas
Then add product, Sales Value, Cost of Sales and the calculated column for Gross Profit to the table
But, if we add the Gross profit percentage that we created as a calculated column to the table we get a problem, the
default summarisation options cannot calculate the true gross profit
Using calculated columns and
measures in reports
Although this initially looks correct, especially at the product row level, but the grand total is not correct
The correct answer should be 1290 divided by 2110, which equals 61.14%
The measure correctly calculates the Gross Profit percentage on the overall values and all rows in the report
Use the measure to show the gross
profit margin
We can use the calculated column values to filter the data for rows with a lower margin
Please note you cannot use a measure value in a slicer because you need to see the individual rows
Use the Calculated Column values if
you need to filter
We have explained the key differences between calculated columns and
measures in Power BI,
With examples of why you will need to use both and some of the
common errors that we see
For more Tips, Tricks and
Timesavers, visit our website
Business Analytics Blog – Select Distinct
Credit: simon.harrison@selectdistinct.co.uk

More Related Content

Similar to Calculated Columns and Measures in Power BI.pptx

Business Analytics 1 Module 4.pdf
Business Analytics 1 Module 4.pdfBusiness Analytics 1 Module 4.pdf
Business Analytics 1 Module 4.pdfJayanti Pande
 
1 Mashing Up Data with PowerPivot When Filter, .docx
1 Mashing Up Data with PowerPivot  When Filter, .docx1 Mashing Up Data with PowerPivot  When Filter, .docx
1 Mashing Up Data with PowerPivot When Filter, .docxkarisariddell
 
Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...
Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...
Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...Cengage Learning
 
Empowerment Technology Lesson 4
Empowerment Technology Lesson 4Empowerment Technology Lesson 4
Empowerment Technology Lesson 4alicelagajino
 
Create a PivotTable to analyze worksheet data.pdf
Create a PivotTable to analyze worksheet data.pdfCreate a PivotTable to analyze worksheet data.pdf
Create a PivotTable to analyze worksheet data.pdfAbubakar Bashir
 
Lesson 18 Creating Pivot Tables
Lesson 18 Creating Pivot TablesLesson 18 Creating Pivot Tables
Lesson 18 Creating Pivot Tablesguevarra_2000
 
Funções DAX.pdf
Funções DAX.pdfFunções DAX.pdf
Funções DAX.pdfJoao Vaz
 
How to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC Group
How to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC GroupHow to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC Group
How to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC GroupEPC Group
 
06 web-analytics tabbed-report-menus
06 web-analytics tabbed-report-menus06 web-analytics tabbed-report-menus
06 web-analytics tabbed-report-menusMassimo Paolini
 
The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...
The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...
The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...PennyJose1
 
How to use a slicer to toggle measures in Power BI
How to use a slicer to toggle measures in Power BIHow to use a slicer to toggle measures in Power BI
How to use a slicer to toggle measures in Power BISelect Distinct Limited
 
Easy Pivot Tutorial June 2020
Easy Pivot Tutorial June 2020Easy Pivot Tutorial June 2020
Easy Pivot Tutorial June 2020Adhi Wikantyoso
 
Calculations for your Equity Analysis assignmentTo start, put .docx
Calculations for your Equity Analysis assignmentTo start, put .docxCalculations for your Equity Analysis assignmentTo start, put .docx
Calculations for your Equity Analysis assignmentTo start, put .docxRAHUL126667
 
What is copa master data
What is copa master dataWhat is copa master data
What is copa master dataRajeev Kumar
 
Calculation contexts in web i
Calculation contexts in web iCalculation contexts in web i
Calculation contexts in web iVenkata Mahesh
 

Similar to Calculated Columns and Measures in Power BI.pptx (20)

Print18
Print18Print18
Print18
 
Business Analytics 1 Module 4.pdf
Business Analytics 1 Module 4.pdfBusiness Analytics 1 Module 4.pdf
Business Analytics 1 Module 4.pdf
 
1 Mashing Up Data with PowerPivot When Filter, .docx
1 Mashing Up Data with PowerPivot  When Filter, .docx1 Mashing Up Data with PowerPivot  When Filter, .docx
1 Mashing Up Data with PowerPivot When Filter, .docx
 
Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...
Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...
Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Compu...
 
Empowerment Technology Lesson 4
Empowerment Technology Lesson 4Empowerment Technology Lesson 4
Empowerment Technology Lesson 4
 
Create a PivotTable to analyze worksheet data.pdf
Create a PivotTable to analyze worksheet data.pdfCreate a PivotTable to analyze worksheet data.pdf
Create a PivotTable to analyze worksheet data.pdf
 
Lesson 18 Creating Pivot Tables
Lesson 18 Creating Pivot TablesLesson 18 Creating Pivot Tables
Lesson 18 Creating Pivot Tables
 
Funções DAX.pdf
Funções DAX.pdfFunções DAX.pdf
Funções DAX.pdf
 
How to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC Group
How to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC GroupHow to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC Group
How to Navigate PerformancePoint 2010 Dashboards and Explore Data - EPC Group
 
06 web-analytics tabbed-report-menus
06 web-analytics tabbed-report-menus06 web-analytics tabbed-report-menus
06 web-analytics tabbed-report-menus
 
The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...
The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...
The Ultimate Guide to Ad5 e808 adobe audience manager business practitioner e...
 
How to use a slicer to toggle measures in Power BI
How to use a slicer to toggle measures in Power BIHow to use a slicer to toggle measures in Power BI
How to use a slicer to toggle measures in Power BI
 
Creating modeled views
Creating modeled viewsCreating modeled views
Creating modeled views
 
Easy Pivot Tutorial June 2020
Easy Pivot Tutorial June 2020Easy Pivot Tutorial June 2020
Easy Pivot Tutorial June 2020
 
Oracle General Ledger GL FSG
Oracle General Ledger GL FSG Oracle General Ledger GL FSG
Oracle General Ledger GL FSG
 
Calculations for your Equity Analysis assignmentTo start, put .docx
Calculations for your Equity Analysis assignmentTo start, put .docxCalculations for your Equity Analysis assignmentTo start, put .docx
Calculations for your Equity Analysis assignmentTo start, put .docx
 
What is copa master data
What is copa master dataWhat is copa master data
What is copa master data
 
Microsoft Excel Tutorial
Microsoft Excel TutorialMicrosoft Excel Tutorial
Microsoft Excel Tutorial
 
Dwh training 1
Dwh training 1Dwh training 1
Dwh training 1
 
Calculation contexts in web i
Calculation contexts in web iCalculation contexts in web i
Calculation contexts in web i
 

More from Select Distinct Limited

Year on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptxYear on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptxSelect Distinct Limited
 
Sync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guideSync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guideSelect Distinct Limited
 
Using Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptxUsing Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptxSelect Distinct Limited
 
Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?Select Distinct Limited
 
How to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by stepHow to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by stepSelect Distinct Limited
 
Top 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular postsTop 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular postsSelect Distinct Limited
 
Top 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog postsTop 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog postsSelect Distinct Limited
 
When to transform data for Power BI.pptx
When to transform data for Power BI.pptxWhen to transform data for Power BI.pptx
When to transform data for Power BI.pptxSelect Distinct Limited
 
Direction of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptxDirection of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptxSelect Distinct Limited
 
Power BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptxPower BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptxSelect Distinct Limited
 

More from Select Distinct Limited (20)

Year on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptxYear on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptx
 
Sync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guideSync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guide
 
Using Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptxUsing Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptx
 
Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?
 
How to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by stepHow to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by step
 
Top 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular postsTop 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular posts
 
Top 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog postsTop 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog posts
 
CTEs in SQL.pptx
CTEs in SQL.pptxCTEs in SQL.pptx
CTEs in SQL.pptx
 
Divide by Zero Errors
Divide by Zero ErrorsDivide by Zero Errors
Divide by Zero Errors
 
When to transform data for Power BI.pptx
When to transform data for Power BI.pptxWhen to transform data for Power BI.pptx
When to transform data for Power BI.pptx
 
Power BI KPIs
Power BI KPIsPower BI KPIs
Power BI KPIs
 
Direction of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptxDirection of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptx
 
UNION in DAX
UNION in DAXUNION in DAX
UNION in DAX
 
APPEND data in Power Query
APPEND data in Power QueryAPPEND data in Power Query
APPEND data in Power Query
 
Power BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptxPower BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptx
 
Group by ROLLUP in SQL Server
Group by ROLLUP in SQL ServerGroup by ROLLUP in SQL Server
Group by ROLLUP in SQL Server
 
Advanced Top N Measures in Power BI
Advanced Top N Measures in Power BIAdvanced Top N Measures in Power BI
Advanced Top N Measures in Power BI
 
Custom Formats in Power BI
Custom Formats in Power BICustom Formats in Power BI
Custom Formats in Power BI
 
SQL Tips UNPIVOT Function.pptx
SQL Tips UNPIVOT Function.pptxSQL Tips UNPIVOT Function.pptx
SQL Tips UNPIVOT Function.pptx
 
Power BI Drill Through
Power BI Drill ThroughPower BI Drill Through
Power BI Drill Through
 

Recently uploaded

Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home ServiceSapana Sha
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 

Recently uploaded (20)

Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 

Calculated Columns and Measures in Power BI.pptx

  • 1. Power BI Tips and Timesavers Calculated Columns And Measures in Power BI
  • 2. A guide to understanding the differences between calculated columns and measures in DAX for Power BI
  • 3. What is a calculated column? A calculated column is a static value added to a table, calculated row by row when you load the data. What is a measure? A measure is a dynamic value that changes based on what you’re looking at in a report, calculated dynamically within the filter context of a visual
  • 4. We will use a Gross Profit Example We start by loading some sample sales data
  • 5. How to create a calculated column The first thing we will do is to calculate the Gross Profit for each row in this table In the table view, select New Column from the Ribbon
  • 6. How to create a calculated column In the formula bar we type Gross Profit = [Sales Value]-[Cost of Sales] This adds a new column, which calculates the gross profit by subtracting the cost of sales from the sales value When we press enter the column is added to the table, and it is calculated for each row of data in that table We also create a Gross Profit Margin calculated column
  • 7. Benefits & Limitations Benefits of Calculated Columns in Power BI One of the most obvious benefits of creating a calculated column in a table is that is easily visible and can be quickly understood. It is calculated once the data refreshes and is not affected by any other filters, effectively it is a static column. This means that it can be used as a filter. In our example we could use a slicer to only show products that have a margin lower than 60% Limitations of Calculated Columns in Power BI Potentially the biggest draw back of calculated columns is that they must be calculated in full before the data table can be used. This is usually not a problem if the data tables are small, but if you import a very large data table, then have complex calculations running down a number of columns you will see a performance impact. In that case it is often better to perform the calculation further back in the data transformation
  • 8. How to create a measure We want to create a measure that can calculate the overall gross profit margin, even if the report is filtered To create the measure, go to the Table View, and click New Measure on the ribbon Then copy and paste this DAX code Gross Profit Margin (Measure) = sum(Sheet1[Gross Profit]) / sum(Sheet1[Sales Value]) When you press enter, the measure is created. But unlike the calculated column, it does not appear in the table view
  • 9. Benefits of Measures in Power BI Measures are only calculated where used and are only calculated in the context of the face value of the report, this way they respond to filters and slicers Limitations of Measures in Power BI Measures can be more difficult to debug as they are more difficult to understand than a calculated column. But it can be made simpler to understand by creating separate measures for elements of a complex calculation. For example in this example we could create a measure for the sum of gross profit (the numerator) and check that. And we could also create a measure for the sum of the Sales (the denominator) and check that. Out gross profit measure could then just be the Numerator / the Denominator allowing us to debug the components separately
  • 10. On the report view, drag a table to the canvas Then add product, Sales Value, Cost of Sales and the calculated column for Gross Profit to the table But, if we add the Gross profit percentage that we created as a calculated column to the table we get a problem, the default summarisation options cannot calculate the true gross profit Using calculated columns and measures in reports
  • 11. Although this initially looks correct, especially at the product row level, but the grand total is not correct The correct answer should be 1290 divided by 2110, which equals 61.14% The measure correctly calculates the Gross Profit percentage on the overall values and all rows in the report Use the measure to show the gross profit margin
  • 12. We can use the calculated column values to filter the data for rows with a lower margin Please note you cannot use a measure value in a slicer because you need to see the individual rows Use the Calculated Column values if you need to filter
  • 13. We have explained the key differences between calculated columns and measures in Power BI, With examples of why you will need to use both and some of the common errors that we see
  • 14. For more Tips, Tricks and Timesavers, visit our website Business Analytics Blog – Select Distinct Credit: simon.harrison@selectdistinct.co.uk