Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
100 views72 pages

Introduction To DAX

DAX (Data Analysis Expressions) is a powerful formula language used in Power BI for performing calculations and creating new fields or tables. It allows users to efficiently solve business problems through simple and complex calculations, utilizing different contexts such as row and filter contexts. DAX can be implemented through measures, calculated columns, and calculated tables, and includes a variety of functions for aggregation, date and time manipulation, logical operations, and more.

Uploaded by

hijjiariff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views72 pages

Introduction To DAX

DAX (Data Analysis Expressions) is a powerful formula language used in Power BI for performing calculations and creating new fields or tables. It allows users to efficiently solve business problems through simple and complex calculations, utilizing different contexts such as row and filter contexts. DAX can be implemented through measures, calculated columns, and calculated tables, and includes a variety of functions for aggregation, date and time manipulation, logical operations, and more.

Uploaded by

hijjiariff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

POWER BI, DAX,

POWER QUERY
Introduction to DAX
DAX —What is DAX

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

https://learn.microsoft.com/en-us/training/paths/dax-power-bi/
DAX —Why use DAX

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 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.
DAX —Where to use DAX

There are three ways you can use DAX formulas in The main difference between these three types of
Power BI calculations is in their CONTEXT (more on this later) and the
outputs they produce.
1. Measures: These calculations will add a summary or
aggregated measure to a table based on a formula. To add any one of these types of calculations to a model,
navigate to the Modeling tab of the ribbon. Here you will
2. Calculated Column: These calculations will add an find three choices for adding either a new measure,
additional column to a table based on a formula. These calculated column, or table. Alternatively, you can right-click
columns are treated like any other field in the table. a table in the Fields pane, and you will get the option to add
a new measure or calculated column in the drop-down
3. Calculated Tables: These calculations will add an menu.
additional table to the report based on a formula.
DAX —Components

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.
DAX —Syntax

1. Name of the measure or column


1 2
2. Dax function

3. Table reference
3 4
4. Column reference
DAX —Functions

1. Aggregate
2. Date and Time
Basic Functions 3. Logical
4. Text
5. Time Intelligence
6. Filter
7. Relationship
Advance Functions 8. Information Function
9. Mathematics and Statistical Functions
10.Table Manipulation Functions

https://learn.microsoft.com/en-us/dax/dax-function-reference
DAX —Context
DAX —Context (Row Context)

In this example, we are calculation Total Profit which


Row Context is done on a row by row basis, so the row context is
In simple terms, row context means “the current row” defined by default in a table.
across all columns of a table and also extends to all However, this is not the case in measures. Since the
columns in related tables too. aggregations are applied for all rows in a table. These
calculations do not need to have any knowledge of a
This type of context lets the DAX formula know which
current row since all rows are aggregated together.
rows to use for a specific formula.
For Instance
Profit margin =
Total Profit = (Sales[Unit Price]-Sales[Unit Cost])*Sales[Units] SUM (financials[Total Profit] ) /
SUM ( financials[Total Sales] )

In this case, the entire Total Profit column is summed to


produce a single number, and this is divided by the sum of
the entire Total Sales column. DAX does not need to know
the current row, since it is performing an aggregation. Thus,
this measure has no row context.

To explicitly define a row context in a measure, you need to


use a special function called an iterator. Examples of iterator
functions are SUMX, AVERAGEX, COUNTX etc (ends with x).
DAX —Context (Row Context)

Total Online Sales =


SUMX(
[Total Sales],
[Store] = ‘Online’ 4 DAX Filter Context
)
Filter Context
2
2 1. Filter Pane
1
2. Slicer
3. Visual (Rows and Columns)
3 4. DAX Measure
3
DAX —Context (Filter Context)
DAX —Calculated Columns vs Measures

Calculated Columns Measures


1. Columns computed using DAX 1. Written using DAX

2. Always computed using current row 2. Don’t work row by row (No concept of current row),
instead use table and aggregators
3. Belong to a particular Table
3. Doesn’t belong to any table
Calculated columns → Table[Column]
Measure → [Measure]
4. Use when need to place in filter 4. Use when calculating percentages, ratios,
(Can’t calculate percentage of Total)
complex aggregations.
5. Consume Storage
5. Consume CPU
DAX —Calculated Columns vs Power Query Columns
Calculated Columns Power Query Columns

1. Columns computed using DAX. 1. Written using M Language

2. Used when simple transformation or 2. Can be used for complicated transformation


calculation is required. and calculations.

3. May add extra columns which are not 3. Extra columns can be removed once they are
even required. used to create custom columns

4. Creating or editing new columns is fast, 4. Create or editing new columns is slower, and
and don’t need to load data table again, table need to be loaded again after the
and making changes are also quick. addition of new column.

5. May cause performance issues with large 5. Since data is loaded, performance is better
dataset. (even though data load may take time).

*If something that doesn't require a lot of changes and can be create done in Power Query, then try to do it in Power Query since it will give better performance
Basic Functions
DAX —Text Functions

• Concatenate, ConcatenateX
• Find, Exact, Search
• Trim, Upper, Lower, Replace
• Format, Rept, Left, Right, Mid
• Unichar, Unicode
• Value, Distinct

https://learn.microsoft.com/en-us/dax/text-functions-dax
DAX —Aggregation Functions (Basic)

1. Used for aggregating Values


• Sum
• Average
• Max
• Min
• Count
• Countrows
2. Aggregate only one column
3. Beside count, works on numeric column

https://learn.microsoft.com/en-us/dax/aggregation-functions-dax
DAX —Aggregation Functions (Iterator or X-Aggregation)

1. Used for aggregating Formulas


• SumX
• AverageX
• MaxX
• MinX
• CountX
2. Iterate over table and evaluate the expression for each row
3. Require two parameters:
• Table to iterate
• Formula to evaluate each row
• functionX(Table, Formula)

https://learn.microsoft.com/en-us/dax/aggregation-functions-dax
DAX —Date & Time Functions

• Calendar, CalendarAuto
• Date, DateValue, DateDiff
• Minute, Hour, Day, Month, Quarter, Year
• Now, UTCNow, UTCToday, Today
• NetworkDays

https://learn.microsoft.com/en-us/dax/date-and-time-functions-dax
DAX —Logical Functions

• AND (&&)
• OR(||)
• NOT(<>)
• IF
• SWITCH

https://learn.microsoft.com/en-us/dax/logical-functions-dax
Advance Functions
DAX —Time Intelligence Functions

• DateAdd, DatesBetween, DatesInPeriod


• DatesMTD, DatesQTD, DatesYTD
• TotalMTD, TotalQTD, TotalYTD
• SamePeriodLastYear
• PreviousMonth, PreviousQuarter, PreviousYear

https://learn.microsoft.com/en-us/dax/time-intelligence-functions-dax
DAX —Filter Functions

• All, AllSelected, AllExcept


• Calculate, CalculateTable
• RemoveFilters, KeepFilters
• SelectedValue
• Filter
• LookUpValue

https://learn.microsoft.com/en-us/dax/filter-functions-dax
DAX —Relationship Functions

• Related
• RelatedTable
• Userelationship

https://learn.microsoft.com/en-us/dax/relationship-functions-dax
DAX —Information Functions

• isNumber, isText, isOdd,


• isEmpty, isBlank, isFiltered
• HasOneValue
• Contains, ContainRows

https://learn.microsoft.com/en-us/dax/information-functions-dax
DAX —Mathematics & Statistic Functions

• Round, Trunc
• Sin, Cos, Tan
• PI
• Divide, Mod
• ABS, Celing, Floor
• RankX
• Median, MedianX

https://learn.microsoft.com/en-us/dax/math-and-trig-functions-dax
https://learn.microsoft.com/en-us/dax/statistical-functions-dax
DAX —Table Functions

• AddColumn, SelectedColumns
• Summarize, SummarizeColumns
• Union
• Values
• Filters
• TopN

https://learn.microsoft.com/en-us/dax/table-manipulation-functions-dax
Functions With Examples
DAX —Divide

Sales Month Over Month =


(CurrentMonth – PrevMonth) / PrevMonth
Sales Month Over Month – Divide =
DIVIDE(CurrentMonth - PrevMonth , PrevMonth, 0)

Safe Divide function with ability to handle


divide by zero or null case.
DAX —Round

Ro"⭲ds a ⭲"mbcí to a spcciricd


⭲"mbcí or digits.
DAX —Trunc

ľí"⭲catcs a ⭲"mbcí to a⭲ i⭲tcgcí bQ


ícmo:i⭲g tkc dccimal, oí ríactio⭲al,
paít or tkc ⭲"mbcí.
DAX —Find

Rct"í⭲s tkc staíti⭲g positio⭲ or o⭲c tcxt


stíi⭲g witki⭲ a⭲otkcí tcxt stíi⭲g. FIND is casc-
sc⭲siti:c a⭲d accc⭲t-sc⭲siti:c.
DAX —Left

Rct"í⭲s tkc spcciricd ⭲"mbcí or


ckaíactcís ríom tkc staít or a tcxt
stíi⭲g.
DAX —CombineValues

Combi⭲cs tkc gi:c⭲ sct or


opcía⭲ds "si⭲g a spcciricd
dclimitcí.
DAX —Sum

Total Sales (Sum) = SUM(Sales[Sales Amount])

Sum Add all the numbers in a single


column
DAX —SumX

Total Sales (SumX) =


SUMX(Sales, Sales[UnitPrice]*Sales[Quantity])

• SUMX first evalute the expression on row


level, i.e. calculate sales amount
(unitPrice*Quantity)

• Using SumX, don’t have to create extra


column Sales Amount, and can perform sum
directly on the relavent values
DAX —If

• Checks whether a condition is met, and


returns one value if TRUE, and another
value if FALSE.

• Either ResultIfTrue or ResultIfFalse


expression result, depending on
LogicalTest.
DAX —Switch

• Returns different results depending


on the value of an expression.

• The resultant value is


1. A defined value coming from one
of the Result expressions, if
there was a match with Value
2. A defined value from the Else
expression, if there was no
match with any Value.
DAX —Switch True

• SWITCH True logic is one of the crucial techniques used to create dynamic
reports. In fact, it’s really the only way that you could create some of the
elements and features of this particular report.
• With Switch True logic, you may apply conditions based on multiple entities.
• The output may be a defined value, or even a measure
DAX —Unichar

Rct"í⭲s tkc U⭲icodc ckaíactcí tkat is ícrcíc⭲ccd bQ tkc gi:c⭲ ⭲"mcíic


:al"c.

https://exceleratorbi.com.au/dax-unichar-function-power-bi/
https://www.vertex42.com/ExcelTips/unicode-symbols.html
DAX —Filter

Total Sales(Black) =
SUMX(
FILTER('Product','Product'[Color] = "Black"),
Sales[Total Sales]
)

• Returns a table that has been filtered


• Can be used in iterator functions (like SUMX for defining
the table), calculate, and other functions where table
reference is required
DAX —Calculate

• Calculate is one of the most special and useful function in DAX.


• What makes is unique is, it ignores all the filters context we get from a visual
and only apply the filter context we provide in our DAX code.
• We may add filter, and we can tell calculate which filters we want to retain
from the visual.
• It is specially helpful for calculating totals and percentages of total since it is
not affected my external filter context.
• Every filter argument can be either a filter removal (such
as ALL, ALLEXCEPT, ALLNOBLANKROW) , a filter restore (ALLSELECTED), or a
table expression returning a list of values for one or more columns or for an
entire expanded table.
• When a filter argument has the form of a predicate with a single column
reference, the expression is embedded into a FILTER expression that filters all
• Evaluates an expression in a context modified by filters the values of the referenced column. For example, the predicate shown in the
first expression is internally converted in the second expression.
• The Expression can be any measure, or calculation
• Filter can be on a table or a column
DAX —Calculate Example 1

Total Sales(Black)-Calculate =
Calculate(
Sales[Total Sales],
'Product'[Color] = "Black"
)

• Calculate ignore the filter context of


‘Product’[Color] coming from the visual

• It then apply it’s own filter context


defined in the filter expression.
DAX —Calculate Example 2

Total Sales Asia =


CALCULATE(
[Total Sales],
Customer[Continent] = "Asia"
)

• Calculate can be use to apply additional


filter

• In this scenario, we need to compare Total


Sales vs Sales in Asia, so we create this
measure
DAX —Calculate Example 3 (With All())

• Returns all the rows in a table, or all the values in a column,


ignoring any filters that might have been applied.

• All() function can be utilized in two ways:


1. all from a Table → All(<Table>)
2. all from a specific column → All(<Table[column]>)

• All('Product') means any filter relating to Product table will be


removed

• All('Product’[Color]) means any filter coming from Color


column of Product Table will be removed.

Total Sales-ALL =
Calculate(
[Total Sales],
ALL('Product'[Color])
)
Total Sales Pct Share =
[Total Sales]/[Total Sales-ALL]
DAX —Format

• Converts a value to text in the specified number format

• Can be used to define format of date, extract year,


month, day etc
DAX —Related

Returns a related value


from another table.
DAX —Selected Values

• Returns the value when there’s only one value in the specified
column, otherwise returns the alternate result.

• The specified value may comes from the visual filter context.

• Can create if else statement, without creating separate


columns.

• For measure, direct reference to the column won’t work due


to the absence of row context, hence, selectedValue return
the single value related to that particular filter context(i.e.
product[color])
DAX —Variables

Variables are useful for several reasons:


1. Readability of the code. By assigning a name to an expression you are effectively adding descriptive
information to your code, making it easier to read it.
SalesPerCustomer :=
VAR SalesAmount =
2. Split of the execution into logical steps. Our brain processes expressions containing variables better, SUMX (
because variables provide execution steps. In the code on right, you might think that SalesAmount is Sales,
computed first, then NumCustomer, and finally the result. Despite this not being true, variables still help Sales[Quantity * Sales[Net Price]
)
read and understand the code. VAR NumCustomer =
DISTINCTCOUNT ( Sales[CustomerKey] )
3. Easier debugging of the code. You can inspect the value of variables using professional debuggers, like RETURN
the Tabular Editor 3 debugger, or you can return the value of a variable in a complex measure to inspect DIVIDE (
the intermediate evaluations. SalesAmount,
NumCustomer
)
4. Better performance. Using variables, you instruct the DAX optimizer on which parts of the entire
expression can be computed once and saved for later use. The value of a variable is computed only
once, whereas repeating the same sub-expression in multiple places does not guarantee a unique
execution of that piece of code.
Date and Time Intelligence Functions
DAX —Date

• Returns a specified date

• This date is static value

• The output is a single date, and can be used for


reference.
DAX —Calendar

• Returns a table with one column of all dates between


StartDate and EndDate.
• The CALENDAR table is useful to create a Date table.
• For compatibility with DAX time intelligence functions,
DateTable = DateTable =
it is a best practice to always include an entire year in CALENDAR ( CALENDAR (
a Date table. DATE ( 2005, 1, 1 ), MIN(Sales[Order Date]),
DATE ( 2015, 12, 31 ) MAX(Sales[Order Date])
) )
DAX —CalendarAuto

• Returns a table with one column of dates, and the dare range is
calculated automatically from the data.

• By default, the fiscal year ends in December (month 12), or we can


specify fiscal year CalendarAuto(6) - June

• CALENDARAUTO uses all the dates in your model, excluding only


calculated columns and tables DateTable = CALENDARAUTO()

*The dataset contains date of birth, so it generates dates from the year of minimum date of the dataset
DAX —Calendar DAX Script
* Select StartYear, EndYear, and Fiscal Year
* StartYear and EndYear can be dynamic by using min(Year(orderDate)) and max(Year(orderDate)) or you may select static year values

DateTable =
VAR FiscalStart = "06"
VAR STARTYEAR = "2015"
VAR ENDYEAR = "2020"
RETURN
ADDCOLUMNS(
CALENDAR(Date(STARTYEAR,01,01),(Date(ENDYEAR,12,31))),
"Year" , YEAR([Date]),
"Short Year" , VALUE(Right(YEAR([Date]),2)),
"Month Number" , Month([Date]),
"Month Number Full" , FORMAT([Date],"MM"),
"Month Full" , FORMAT([Date],"MMMM"),
"Month Abbr" , FORMAT ([Date],"MMM"),
"Week Number", WEEKNUM([Date]),
"Week Number Full" , Format(WEEKNUM([Date]),"00"),
"Day of Month" , DAY([Date]),
"Day of Month Full" , FORMAT(Day([Date]),"00"),
"Day of Week" , WEEKDAY([Date]),
"Day of Week Full" , FORMAT([Date],"dddd"),
"Day of Week Abbr" , FORMAT([Date],"ddd"),
"ISO Date" , YEAR([Date])&FORMAT(Day([Date]),"00")&FORMAT(Day([Date]),"00"),
"Full Date" , DAY([Date])&" "&FORMAT([Date],"MMMM")&" "&YEAR([Date]),
"Quarter Full" , "Quarter " & ROUNDDOWN(Month([Date])/4,0)+1,
"Quarter Abbr" , "Qtr " & ROUNDDOWN(Month([Date])/4,0)+1,
"Quarter" , "Q" & ROUNDDOWN(Month([Date])/4,0)+1,
"Quarter Number" , Format(ROUNDDOWN(Month([Date])/4,0)+1,"00"),
"Quarter and Year" , "Q" & ROUNDDOWN(Month([Date])/4,0)+1 & " "& YEAR([Date]),
"Month and Year Abbr" , FORMAT ([Date],"MMM") & " " & YEAR([Date]),
"Quarter and Year Number" , YEAR([Date])&Format(ROUNDDOWN(Month([Date])/4,0)+1,"00"),
"Year and Week", VALUE(YEAR([Date])&FORMAT(WEEKNUM([Date]),00)),
"Year and Month Number", VALUE((YEAR([Date])&FORMAT([Date],"MM"))),
"IS Work Day" , IF(OR(WEEKDAY([Date])=1, WEEKDAY([Date])=7),"NO","YES"),
"Current Month", IF(DATEDIFF(TODAY(),[Date],MONTH)=0,"Yes","No"),
"Current Year", IF(DATEDIFF(TODAY(),[Date],Year)=0,"Yes", "No"),
"Month Offset", (DATEDIFF(TODAY(),[Date],MONTH)),
"Day Offset", (DATEDIFF(TODAY(),[Date],DAY)),
"Fiscal Year", IF(FiscalStart <= FORMAT([Date],"MM"), "FY"&(YEAR([Date])+1),"FY"&YEAR([Date])),
"Fiscal Month", Value(IF(FiscalStart <= FORMAT([Date],"MM"), (Month([Date]) -FiscalStart+1), ((12-FiscalStart+1)+Month([Date])))),
"Fiscal Quarter", If (Value(IF(FiscalStart <= FORMAT([Date],"MM"), (Month([Date]) -FiscalStart+1), ((12-FiscalStart+1)+Month([Date])))) < 4,"Q1",
If (Value(IF(FiscalStart <= FORMAT([Date],"MM"), (Month([Date]) -FiscalStart+1), ((12-FiscalStart+1)+Month([Date])))) < 7,"Q2",
If (Value(IF(FiscalStart <= FORMAT([Date],"MM"), (Month([Date]) -FiscalStart+1), ((12-FiscalStart+1)+Month([Date])))) < 10,"Q3","Q4"))))
DAX —Year & Month

Rct"í⭲s tkc Qcaí or a datc as a ro"í digit i⭲tcgcí.

Rct"í⭲s a ⭲"mbcí ríom 1 (Ja⭲"aíQ) to 12


(Kcccmbcí) ícpícsc⭲ti⭲g tkc mo⭲tk.
DAX —StartofMonth

Rct"í⭲s tkc staít or tkc mo⭲tk.


DAX —EndofMonth

Rct"í⭲s tkc c⭲d or tkc mo⭲tk.


DAX —Format With Dates
DAX —Importance of Calendar Table

• A calendar table in PowerBI is a table that contains a complete set of dates for a specified date range.
• This table is used to create relationships between date-based columns in other tables, making it easier to perform time-
based calculations and visualizations.
• Some of the benefits of using a Calendar Table are:
1. Simplifies time-based calculations: By creating a relationship between the calendar table and other tables with
date-based columns, you can easily perform time-based calculations and visualizations, such as year-to-date
(YTD) sales, monthly averages, and quarterly trends.
2. Enhances data visualization: With a calendar table, you can easily create visuals that show the distribution of
data over time, such as line charts, bar charts, and area charts.
3. Improves data accuracy: By using a calendar table, you can ensure that the data is consistent across different
tables and visuals. It also eliminates the possibility of missing dates in the data and ensures that all dates are
displayed correctly in the visuals.
4. Increases data flexibility: A calendar table makes it easier to change the date range of a report or dashboard
without having to modify individual visuals or calculations.
5. Overall, a calendar table is an important tool in PowerBI that enables you to perform time-based calculations and
create meaningful visualizations with your data.
DAX —DateDiff

• Return the difference between two dates in the unit of


interval defined.

• Result is positive if Date2 is the bigger date


DAX —DateDiff Example

• Today() gives the current Date

• Getting the date difference between today’s date and


birthday can be used for calculating Age.
DAX —Networking Days

• Returns the number of whole workdays


between two dates (inclusive) using parameters
to indicate which and how many days are
weekend days.
• Weekend days and any days that are specified
as holidays are not considered as workdays.
DAX —DatesBetween

Returns the dates between the two define dates


DAX —DatesInPeriod

• Returns the dates from the given period

• Works same as DatesBetween, just different syntax


DAX —DateAdd

• Moves the date by the specified Interval

• If the NumberOfInterval is positive, date move forward, if


negative then date move backwards

*Use Date Table for Time Intelligence Calculations


DAX —DateAdd (Month over Month)

Sales Month Over Month


=
VAR PrevMonth =
CALCULATE(
[Total Sales],
DATEADD('Calendar'[Date], -1, MONTH)
)
VAR CurrentMonth = [Total Sales]

RETURN
DIVIDE(CurrentMonth - PrevMonth , PrevMonth, 0)
DAX —DateAdd (Year over Year)

Total Sales Year Over Year =


VAR PrevYear = CALCULATE([Total Sales], DATEADD('Calendar'[Date], -1, YEAR))
VAR CurrYear = [Total Sales]
RETURN
DIVIDE(CurrYear - PrevYear, PrevYear,0)
DAX —SamePeriodLastYear

Total Sales Year Over Year - SPLY =


VAR PrevYear = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Calendar'[Date]))
VAR CurrYear = [Total Sales]
RETURN
DIVIDE(CurrYear - PrevYear, PrevYear,0)

Rct"í⭲s a sct or datcs i⭲tkc c"ííc⭲t sclcctio⭲ ríom


tkc píc:io"s Qcaí.
DAX —TotalMTD

Total Sales MTD =


TOTALMTD([Total Sales], 'Calendar'[Date])

E:al"atcs tkc spcciricd cxpícssio⭲ o:cí tkc i⭲tcí:al wkick


bcgi⭲s o⭲ tkc riíst or tkc mo⭲tk a⭲d c⭲ds witk tkc last datc i⭲
tkc spcciricd datc col"m⭲ artcí applQi⭲g spcciricd riltcís.
DAX —TotalYTD

Total Sales YTD =


TOTALYTD([Total Sales], 'Calendar'[Date])

E:al"atcs tkc spcciricd cxpícssio⭲ o:cí tkc i⭲tcí:al


wkick bcgi⭲s o⭲ tkc riíst daQ or tkc Qcaí a⭲d c⭲ds witk
tkc last datc i⭲ tkc spcciricd datc col"m⭲ artcí applQi⭲g
spcciricd riltcís.
Resources
DAX - Free Resources

1. https://dax.guide/
2. https://learn.microsoft.com/en-us/training/browse/?products=power-bi
3. https://learn.microsoft.com/en-us/dax/
4. https://learn.microsoft.com/en-us/dax/dax-function-reference
5. https://www.sqlbi.com/learn/introducing-dax-video-course
6. Udemy PowerBI Dashboard Tutorial
7. Power BI for Beginners
8. Data Visualization With Power BI
9. Analysing and Visualizing Data with Power BI

You might also like