SlideShare a Scribd company logo
1 of 3
Download to read offline
What is DAX?
DAX or Data Analysis Expressions drive all the calculations you can perform in
Power BI. DAX formulas are versatile, dynamic, and very powerful – they allow you
to create new fields and even new tables in your model. While DAX is most
commonly associated with Power BI, you can also find DAX formulas in Power Pivot
in Excel and SQL Server Analysis Services (SSAS).
DAX formulas are made up of 3 core components and this tutorial will cover each of
these:
 Syntax – Proper DAX syntax is made up of a variety of elements, some of
which are common to all formulas.
 Functions – DAX functions are predefined formulas that take some
parameters and perform a specific calculation.
 Context – DAX uses context to determine which rows should be used to
perform a calculation.
Why is DAX Important in Power BI?
DAX formulas allow you to get the most out of your data and Power BI in
order to solve business problems efficiently. You can perform simple
calculations (such as a simple sum or average) and create most visuals
without even touching DAX. For example, if you wanted to create a
simple chart showing total profit you could simply drag the profit field
onto the Values section of the chart, and it would perform a sum of the
rows in that field.
There are two cases where it would be better to create a DAX formula:
1. If you wanted to re-use a formula in multiple places, such as in
multiple charts or as an expression in other DAX formulas. In this case,
using a DAX formula would make your report more efficient and easier
to change in the future since you would only need to change a single
formula rather than changing many individual formulas in each place
they are used.
2. If you wanted to create complex or customized formulas where just
a simple SUM or AVERAGE would not be sufficient for the business
problem you were trying to solve.
Where are DAX Formulas Used in Power BI?
There are three ways you can use DAX formulas in Power BI:
1. Calculated Tables - These calculations will add an additional table
to the report based on a formula.
2. Calculated Columns - These calculations will add an additional
column to a table based on a formula. These columns are treated like any
other field in the table.
3. Measures - These calculations will add a summary or aggregated
measure to a table based on a formula.
The main difference between these three types of calculations is in their
context (more on this later) and the outputs they produce.
To add any one of these types of calculations to a model, navigate to the
Modeling tab of the ribbon. Here you will find three choices for adding
either a new measure, calculated column, or table. Alternatively, you can
right-click a table in the Fields pane, and you will get the option to add a
new measure or calculated column in the drop-down menu.
How to Write a DAX Formula
DAX formulas are intuitive and easy to read. This makes it easy to
understand the basics of DAX so you can start writing your own formulas
relatively quickly. Let’s go over the building blocks of proper DAX syntax.
1. The name of the measure or calculated column
2. The equal-to operator (“=”) indicates the start of the formula
3. A DAX function
4. Opening (and closing) parentheses (“()”)
5. Column and/or table references
6. Note that each subsequent parameter in a function is separated by
a comma (“,”)DAX functions can also be nested inside each other to
perform multiple operations efficiently. This can save a lot of time when
writing DAX formulas. For example, it is often useful to have multiple
nested IF statements or to use the IFERROR function to wrap around
another function, so that any errors in the formula are represented by
the value you specify.
Some of the most common DAX functions used in reports are:
1. Simple calculations: COUNT, DISTINCTCOUNT, SUM, AVERAGE,
MIN, MAX.
2. SUMMARISE: Returns a table typically used to further apply
aggregations over different groupings.
3. CALCULATE: Performs an aggregation along with one or more
filters. When you specify more than one filter, the function will perform
the calculation where all filters are true.
4. IF: Based on a logical condition, it will return a different value for
if it is true or false. This is similar to the CASE WHEN operation in SQL.
5. IFERROR: Looks for any errors for an inner function and returns a
specified result
6. ISBLANK: Checks if the rows in a column are blank and returns
true or false. Useful to use in conjunction with other functions like IF.
7. EOMONTH: Returns the last day of the month of a given date
(column reference in a date format) for as many months in the past or
the future.
8. DATEDIFF: returns the difference between 2 dates (both as column
references in date formats) in days, months, quarters, years, etc.

More Related Content

Similar to DAX.pdf

Excel Tips
Excel TipsExcel Tips
Excel Tipskktv
 
Microsoft Excel Tips
Microsoft Excel TipsMicrosoft Excel Tips
Microsoft Excel Tipsmifarooqui
 
LESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptx
LESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptxLESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptx
LESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptxmarybethgrabillo1
 
Excel Useful Tips
Excel Useful TipsExcel Useful Tips
Excel Useful TipsParul_100in
 
IBM SPSS Custom Tables create custom tabls inn no time.pdf
IBM  SPSS Custom Tables create custom tabls inn no time.pdfIBM  SPSS Custom Tables create custom tabls inn no time.pdf
IBM SPSS Custom Tables create custom tabls inn no time.pdfahmedmaths03
 
Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tipsMohsin Azad
 
Excel for research
Excel  for researchExcel  for research
Excel for researchJamalBhai
 
Top 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowTop 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowAlexHenderson59
 

Similar to DAX.pdf (20)

Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Microsoft Excel Tips
Microsoft Excel TipsMicrosoft Excel Tips
Microsoft Excel Tips
 
LESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptx
LESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptxLESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptx
LESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptx
 
Excel Useful Tips
Excel Useful TipsExcel Useful Tips
Excel Useful Tips
 
Excel tips 172
Excel tips 172Excel tips 172
Excel tips 172
 
Spreadsheet new
Spreadsheet newSpreadsheet new
Spreadsheet new
 
G10 Unit 4.pptx
G10 Unit 4.pptxG10 Unit 4.pptx
G10 Unit 4.pptx
 
IBM SPSS Custom Tables create custom tabls inn no time.pdf
IBM  SPSS Custom Tables create custom tabls inn no time.pdfIBM  SPSS Custom Tables create custom tabls inn no time.pdf
IBM SPSS Custom Tables create custom tabls inn no time.pdf
 
Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tips
 
Excel tips
Excel tipsExcel tips
Excel tips
 
Excel tips
Excel tipsExcel tips
Excel tips
 
Excel Useful Tips
Excel Useful TipsExcel Useful Tips
Excel Useful Tips
 
35 Useful Excel Tips
35 Useful Excel Tips35 Useful Excel Tips
35 Useful Excel Tips
 
Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tips
 
Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tips
 
Getting power bi
Getting power biGetting power bi
Getting power bi
 
Lect11
Lect11Lect11
Lect11
 
Excel for research
Excel  for researchExcel  for research
Excel for research
 
Top 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowTop 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must know
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 

More from Satishkumar722293

More from Satishkumar722293 (20)

What is artificial intelligence.pdf
What is artificial intelligence.pdfWhat is artificial intelligence.pdf
What is artificial intelligence.pdf
 
CAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdfCAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdf
 
What Is Business Plan.pdf
What Is Business Plan.pdfWhat Is Business Plan.pdf
What Is Business Plan.pdf
 
WHAT IS HTML.pdf
WHAT IS HTML.pdfWHAT IS HTML.pdf
WHAT IS HTML.pdf
 
What is artificial intelligence.pdf
What is artificial intelligence.pdfWhat is artificial intelligence.pdf
What is artificial intelligence.pdf
 
Contingent Staffing.pdf
Contingent Staffing.pdfContingent Staffing.pdf
Contingent Staffing.pdf
 
Digital Marketing.pdf
Digital Marketing.pdfDigital Marketing.pdf
Digital Marketing.pdf
 
Employment Relationship.pdf
Employment Relationship.pdfEmployment Relationship.pdf
Employment Relationship.pdf
 
programming testing.pdf
programming testing.pdfprogramming testing.pdf
programming testing.pdf
 
TRAINING & PLACEMENT CELL.pdf
TRAINING & PLACEMENT CELL.pdfTRAINING & PLACEMENT CELL.pdf
TRAINING & PLACEMENT CELL.pdf
 
Training & Development.pdf
Training & Development.pdfTraining & Development.pdf
Training & Development.pdf
 
What is artificial intelligence.pdf
What is artificial intelligence.pdfWhat is artificial intelligence.pdf
What is artificial intelligence.pdf
 
HUMAN RESOURCE MANAGEMENT.pdf
HUMAN RESOURCE MANAGEMENT.pdfHUMAN RESOURCE MANAGEMENT.pdf
HUMAN RESOURCE MANAGEMENT.pdf
 
CAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdfCAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdf
 
programming testing.pdf
programming testing.pdfprogramming testing.pdf
programming testing.pdf
 
DATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdfDATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdf
 
DATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdfDATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdf
 
MANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdfMANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdf
 
WHAT IS HTML.pdf
WHAT IS HTML.pdfWHAT IS HTML.pdf
WHAT IS HTML.pdf
 
MANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdfMANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdf
 

Recently uploaded

Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...shivangimorya083
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceanilsa9823
 
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理cowagem
 
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home MadeDubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Madekojalkojal131
 
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳anilsa9823
 
Biography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO GoogleBiography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO GoogleHafizMuhammadAbdulla5
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineBruce Bennett
 
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkSujalTamhane
 
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls DubaiDark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls Dubaikojalkojal131
 
Motilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptxMotilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptxMaulikVasani1
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjLewisJB
 
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...ranjana rawat
 
Résumé (2 pager - 12 ft standard syntax)
Résumé (2 pager -  12 ft standard syntax)Résumé (2 pager -  12 ft standard syntax)
Résumé (2 pager - 12 ft standard syntax)Soham Mondal
 
Delhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...
TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...
TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...robinsonayot
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfKen Fuller
 

Recently uploaded (20)

Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
 
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCeCall Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
 
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Munirka 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理
 
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home MadeDubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
 
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
 
Biography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO GoogleBiography of Sundar Pichai, the CEO Google
Biography of Sundar Pichai, the CEO Google
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmk
 
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls DubaiDark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
 
Motilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptxMotilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptx
 
VVVIP Call Girls In East Of Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In East Of Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In East Of Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In East Of Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbj
 
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Saswad Call Girls Pune 8250192130Low Budget Full Independent High P...
 
Résumé (2 pager - 12 ft standard syntax)
Résumé (2 pager -  12 ft standard syntax)Résumé (2 pager -  12 ft standard syntax)
Résumé (2 pager - 12 ft standard syntax)
 
Delhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Nehru Place 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...
TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...
TEST BANK For Evidence-Based Practice for Nurses Appraisal and Application of...
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
 

DAX.pdf

  • 1. What is DAX? DAX or Data Analysis Expressions drive all the calculations you can perform in Power BI. DAX formulas are versatile, dynamic, and very powerful – they allow you to create new fields and even new tables in your model. While DAX is most commonly associated with Power BI, you can also find DAX formulas in Power Pivot in Excel and SQL Server Analysis Services (SSAS). DAX formulas are made up of 3 core components and this tutorial will cover each of these:  Syntax – Proper DAX syntax is made up of a variety of elements, some of which are common to all formulas.  Functions – DAX functions are predefined formulas that take some parameters and perform a specific calculation.  Context – DAX uses context to determine which rows should be used to perform a calculation. Why is DAX Important in Power BI? DAX formulas allow you to get the most out of your data and Power BI in order to solve business problems efficiently. You can perform simple calculations (such as a simple sum or average) and create most visuals without even touching DAX. For example, if you wanted to create a simple chart showing total profit you could simply drag the profit field onto the Values section of the chart, and it would perform a sum of the rows in that field. There are two cases where it would be better to create a DAX formula: 1. If you wanted to re-use a formula in multiple places, such as in multiple charts or as an expression in other DAX formulas. In this case, using a DAX formula would make your report more efficient and easier to change in the future since you would only need to change a single formula rather than changing many individual formulas in each place they are used. 2. If you wanted to create complex or customized formulas where just a simple SUM or AVERAGE would not be sufficient for the business problem you were trying to solve.
  • 2. Where are DAX Formulas Used in Power BI? There are three ways you can use DAX formulas in Power BI: 1. Calculated Tables - These calculations will add an additional table to the report based on a formula. 2. Calculated Columns - These calculations will add an additional column to a table based on a formula. These columns are treated like any other field in the table. 3. Measures - These calculations will add a summary or aggregated measure to a table based on a formula. The main difference between these three types of calculations is in their context (more on this later) and the outputs they produce. To add any one of these types of calculations to a model, navigate to the Modeling tab of the ribbon. Here you will find three choices for adding either a new measure, calculated column, or table. Alternatively, you can right-click a table in the Fields pane, and you will get the option to add a new measure or calculated column in the drop-down menu. How to Write a DAX Formula DAX formulas are intuitive and easy to read. This makes it easy to understand the basics of DAX so you can start writing your own formulas relatively quickly. Let’s go over the building blocks of proper DAX syntax. 1. The name of the measure or calculated column 2. The equal-to operator (“=”) indicates the start of the formula 3. A DAX function 4. Opening (and closing) parentheses (“()”) 5. Column and/or table references 6. Note that each subsequent parameter in a function is separated by a comma (“,”)DAX functions can also be nested inside each other to
  • 3. perform multiple operations efficiently. This can save a lot of time when writing DAX formulas. For example, it is often useful to have multiple nested IF statements or to use the IFERROR function to wrap around another function, so that any errors in the formula are represented by the value you specify. Some of the most common DAX functions used in reports are: 1. Simple calculations: COUNT, DISTINCTCOUNT, SUM, AVERAGE, MIN, MAX. 2. SUMMARISE: Returns a table typically used to further apply aggregations over different groupings. 3. CALCULATE: Performs an aggregation along with one or more filters. When you specify more than one filter, the function will perform the calculation where all filters are true. 4. IF: Based on a logical condition, it will return a different value for if it is true or false. This is similar to the CASE WHEN operation in SQL. 5. IFERROR: Looks for any errors for an inner function and returns a specified result 6. ISBLANK: Checks if the rows in a column are blank and returns true or false. Useful to use in conjunction with other functions like IF. 7. EOMONTH: Returns the last day of the month of a given date (column reference in a date format) for as many months in the past or the future. 8. DATEDIFF: returns the difference between 2 dates (both as column references in date formats) in days, months, quarters, years, etc.