DAX.pdf

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).

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.

Recomendados

Quick start learn dax basics in 30 minutes von
Quick start   learn dax basics in 30 minutesQuick start   learn dax basics in 30 minutes
Quick start learn dax basics in 30 minutesКомпания Робот Икс
1.9K views16 Folien
Funções DAX.pdf von
Funções DAX.pdfFunções DAX.pdf
Funções DAX.pdfJoao Vaz
21 views705 Folien
E-Book 25 Tips and Tricks MS Excel Functions & Formulaes von
E-Book 25 Tips and Tricks MS Excel Functions & FormulaesE-Book 25 Tips and Tricks MS Excel Functions & Formulaes
E-Book 25 Tips and Tricks MS Excel Functions & FormulaesBurCom Consulting Ltd.
24.1K views58 Folien
Dax best practices.pdf von
Dax best practices.pdfDax best practices.pdf
Dax best practices.pdfdeepneuron
223 views6 Folien
Microsoft Excel | Master Excel | Advance Excel | Excel von
Microsoft Excel | Master Excel | Advance Excel | Excel Microsoft Excel | Master Excel | Advance Excel | Excel
Microsoft Excel | Master Excel | Advance Excel | Excel devbhargav1
8 views11 Folien
CheatSheet_DAX_EN.pdf von
CheatSheet_DAX_EN.pdfCheatSheet_DAX_EN.pdf
CheatSheet_DAX_EN.pdfKenz31
75 views1 Folie

Más contenido relacionado

Similar a DAX.pdf

Microsoft Excel | Master Excel | Advance Excel | Excel von
Microsoft Excel | Master Excel | Advance Excel | Excel Microsoft Excel | Master Excel | Advance Excel | Excel
Microsoft Excel | Master Excel | Advance Excel | Excel devbhargav1
5 views8 Folien
Microsoft Excel Training von
Microsoft Excel TrainingMicrosoft Excel Training
Microsoft Excel TrainingHudaRaghibKadhim
506 views78 Folien
Excel Tips von
Excel TipsExcel Tips
Excel TipsSpicy Flavours
746 views55 Folien
Excel Tips von
Excel TipsExcel Tips
Excel TipsKritika
463 views54 Folien
Microsoft Excel Tips von
Microsoft Excel TipsMicrosoft Excel Tips
Microsoft Excel Tipsmifarooqui
706 views54 Folien
Excel Tips von
Excel TipsExcel Tips
Excel Tipskktv
769 views54 Folien

Similar a DAX.pdf(20)

Microsoft Excel | Master Excel | Advance Excel | Excel von devbhargav1
Microsoft Excel | Master Excel | Advance Excel | Excel Microsoft Excel | Master Excel | Advance Excel | Excel
Microsoft Excel | Master Excel | Advance Excel | Excel
devbhargav15 views
Excel Tips von Kritika
Excel TipsExcel Tips
Excel Tips
Kritika463 views
Microsoft Excel Tips von mifarooqui
Microsoft Excel TipsMicrosoft Excel Tips
Microsoft Excel Tips
mifarooqui706 views
Excel Tips von kktv
Excel TipsExcel Tips
Excel Tips
kktv769 views
LESSON-4-HOW-DO-I-USE-ADVANCED-EXCEL-TOOLS-TO-PROCESS-AND-PRESENTDATA.pptx von marybethgrabillo1
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

Más de Satishkumar722293

TARGET AUDIENCE.pdf von
TARGET AUDIENCE.pdfTARGET AUDIENCE.pdf
TARGET AUDIENCE.pdfSatishkumar722293
4 views3 Folien
CAREER DEVELOPMENT.pdf von
CAREER DEVELOPMENT.pdfCAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdfSatishkumar722293
4 views3 Folien
DAX.pdf von
DAX.pdfDAX.pdf
DAX.pdfSatishkumar722293
6 views3 Folien
WHAT IS JVM.pdf von
WHAT IS JVM.pdfWHAT IS JVM.pdf
WHAT IS JVM.pdfSatishkumar722293
3 views3 Folien
Data Science.pdf von
Data Science.pdfData Science.pdf
Data Science.pdfSatishkumar722293
6 views5 Folien
JAVA SCRIPT.pdf von
JAVA SCRIPT.pdfJAVA SCRIPT.pdf
JAVA SCRIPT.pdfSatishkumar722293
3 views3 Folien

Más de Satishkumar722293(20)

Último

Public Speaking von
Public SpeakingPublic Speaking
Public SpeakingBasel Ahmed
45 views11 Folien
Software Engineer's Career Management Toolkit von
Software Engineer's Career Management ToolkitSoftware Engineer's Career Management Toolkit
Software Engineer's Career Management Toolkitozgengungor1
17 views41 Folien
kibria_portfolio.pdf von
kibria_portfolio.pdfkibria_portfolio.pdf
kibria_portfolio.pdfMasumKhan59
6 views17 Folien
IIBA Adelaide Lean Coffee - FOBA & other Acronyms von
IIBA Adelaide Lean Coffee - FOBA & other AcronymsIIBA Adelaide Lean Coffee - FOBA & other Acronyms
IIBA Adelaide Lean Coffee - FOBA & other AcronymsAustraliaChapterIIBA
18 views11 Folien
Readiness Quiz - Sr. Engineer.pptx von
Readiness Quiz - Sr. Engineer.pptxReadiness Quiz - Sr. Engineer.pptx
Readiness Quiz - Sr. Engineer.pptxguptanavneet1
443 views7 Folien
sample-resumes.docx von
sample-resumes.docxsample-resumes.docx
sample-resumes.docxKimQadasha
6 views2 Folien

Último(14)

Software Engineer's Career Management Toolkit von ozgengungor1
Software Engineer's Career Management ToolkitSoftware Engineer's Career Management Toolkit
Software Engineer's Career Management Toolkit
ozgengungor117 views
Readiness Quiz - Sr. Engineer.pptx von guptanavneet1
Readiness Quiz - Sr. Engineer.pptxReadiness Quiz - Sr. Engineer.pptx
Readiness Quiz - Sr. Engineer.pptx
guptanavneet1443 views
WordCamp (Why fret over AI overlords when you can befriend them).pdf von BiaAhmed1
WordCamp (Why fret over AI overlords when you can befriend them).pdfWordCamp (Why fret over AI overlords when you can befriend them).pdf
WordCamp (Why fret over AI overlords when you can befriend them).pdf
BiaAhmed125 views
SUDIP DHAR Resume.pdf von Sudip Dhar
SUDIP DHAR  Resume.pdfSUDIP DHAR  Resume.pdf
SUDIP DHAR Resume.pdf
Sudip Dhar13 views
Readiness Quiz - Staff Engineer.pptx von guptanavneet1
Readiness Quiz - Staff Engineer.pptxReadiness Quiz - Staff Engineer.pptx
Readiness Quiz - Staff Engineer.pptx
guptanavneet1621 views
Resume_McCauleyFynnBullock-1 (1).pdf von FynnBullock
Resume_McCauleyFynnBullock-1 (1).pdfResume_McCauleyFynnBullock-1 (1).pdf
Resume_McCauleyFynnBullock-1 (1).pdf
FynnBullock16 views
Danny Gaethofs CV - n English.pdf von Danny Gaethofs
Danny Gaethofs  CV - n English.pdfDanny Gaethofs  CV - n English.pdf
Danny Gaethofs CV - n English.pdf
Danny Gaethofs13 views

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.