SUM FORMULA IN
POWER BI
Definition: SUM is a simple aggregation function that adds up all
the values in a single column.
Example
Total_Sales = SUM(SalesData[Sales])
Use Case: Use SUM when you want to sum up all the values
in a numeric column without any complex row-by-row
operations.
Performance: Since it operates directly on a column, it's fast
and efficient for simple summations.
CALCULATED COLUMN IN
POWER BI
Definition: A calculated column is a new column that you create in a
table using DAX (Data Analysis Expressions). The value for each row is
calculated when the column is created, and it remains static unless
the data is refreshed.
Example
Tax = SalesData[Total_Sales]*18/100
Use Cases: Suitable for scenarios where you need a value for each
row in the table, such as adding a new field derived from existing
data (e.g., creating a "Total Price" column by multiplying "Quantity"
and "Price").
Performance: Since calculated columns are stored in the model,
CALCULATED COLUMN IN
POWER BI
CALCULATED COLUMN IN
POWER BI
DIFFERENCE BETWEEN CALCULATED COLUMN AND MEASURE IN POWER BI
In Power BI, both calculated columns and measures are used to perform calculations,
but they serve different purposes and behave differently. Here's a comparison of the two:
SUMX
FORMULA
SUMX FORMULA IN
POWER BI
Definition: SUMX is an iterator function that performs row-by-
row calculations and then sums the results.
Example
Total_Sales2 = SUMX(SalesData,SalesData[Quantity]*SalesData[Unit
Price (INR)])
Use Case: Use SUMX when you need to perform a calculation for
each row before summing, such as multiplying two columns together
or applying conditional logic.
Performance: SUMX can be slower than SUM because it performs
calculations on each row individually before summing. It's ideal for
more complex scenarios that require row context.
DIFFERENCE BETWEEN SUM AND SUMX FORMULA IN
POWER BI
In Power BI, both SUM and SUMX are used to perform summation, but they work
differently
and are used in different scenarios. Here's a breakdown of the key differences:
COUNT
FORMULA
COUNT FORMULA IN
POWER BI
•Definition: COUNT counts the number of non-blank values in a column.
•Example
•Number of Customers = COUNT('Table'[Customer ID])
Use Case: When you want to count the non-empty values in a
column.
COUNTA
FORMULA
COUNTA FORMULA IN
POWER BI
Definition: COUNTA counts the number of non-blank values in a
column, including text, numeric values, and logical values even
counts Boolean values where only Count will not count Boolean data
type
Example
Number of Reviews = COUNTA('Table'[Review Status])
Use Case: When you need to count all non-blank values, regardless of
the
data type (text, numbers, etc.).
COUNTBLANK
FORMULA
COUNTBLANK FORMULA IN POWER
BI
•Definition: COUNTBLANK counts the number of blank (empty) values in a column.
•Example
•Blank Reveiws = COUNTBLANK('Table'[Review Points])
Use Case: When you want to count the number of blank or missing
values
in a column.
COUNTROWS
FORMULA
COUNTROWS FORMULA IN POWER BI
Definition: COUNTROWS counts the number of rows in a
table.
Example
Total Records = COUNTROWS('Table')
Use Case: When you want to count the total number of rows in a table
or in
a filtered table.
DISTINCTCOUNT
FORMULA
DISTINCTCOUNT FORMULA
•Definition: DISTINCTCOUNT counts the number of unique, non-blank values in a column.
•Example
•Unique States = DISTINCTCOUNT('Table'[State])
Use Case: When you need to count the distinct (unique) values in
a
column, excluding blanks.
COUNTX
FORMULA
COUNTX FORMULA
Definition: COUNTX is an iterator function that counts non-blank
results of an expression evaluated row by row over a table.
Example
Count Reviews >= 5 = COUNTX('Table', IF('Table'[Review Points] >= 5, 1,
BLANK()))
Use Case: When you need to count based on an expression that
is
evaluated for each row in a table.
COUNTAX
FORMULA
COUNTAX
FORMULA
Definition: COUNTAX is the iterator version of COUNTA. It evaluates
an expression for each row and counts the number of non-blank
results.
Example
Count True = COUNTAX(FILTER('Table','Table'[Review
Status]=true),'Table'[Review Status])
Use Case: When you need to count based on an expression that
is
evaluated for each row in a table even there is Binary data type.
COUNTROWS
with
FILTER
FORMULA
COUNTROWS WITH FILTER FORMULA
•Definition: COUNTROWS can be used with the FILTER function to count rows that meet
specific criteria.
•Example
•Maharashtra Count = COUNTROWS(FILTER('Table','Table'[State]="Maharashtra"))
Use Case: When you want to count rows based on a condition or set
of
conditions.
SUMMARY OF DAX COUNTING FUNCTIONS:
These functions provide flexibility depending on whether you're counting all rows,
distinct
values, non-blank values, or values based on expressions and conditions.
DATE
FORMULAS
Extract
Day/Month/Year
EXTRACT DAY/MONTH/YEAR
DAY(<datetime>) : Extracts the day from a date value.
MONTH(<datetime>) : Extracts the month from a date
value. YEAR(<datetime>) : Extracts the year from a date
value.
EXTRACT HOUR/MINUTE/SECOND
Hour(<datetime>) : Extracts the Hour from a date and time value.
Minute(<datetime>) : Extracts the Minute from a date and time
value. Second(<datetime>) : Extracts the Second from a date and
time value.
EXTRACT HOUR/MINUTE/SECOND
Today() : Show Current date
Now() – Show current date and Time
Weekday() – Show Weekday in numbers between 1 to
7 Weeknum() – Show Week number in Month/Year
DATEDIFF
FORMULA
Definition: Returns the difference between two dates in the
specified interval (days, months, years, etc.).
Syntax
DATEDIFF(<start_date>, <end_date>, <interval>)
Example
DATEDIFF(Sales[OrderDate], Sales[ShipDate], DAY)
Create
Custom
Calendar
1 . CREATE CUSTOM CALENDAR IN POWER
QUERY
Formula
= List.Dates(#date(2023,1,1),731,#duration(1,0,0,0))
Creating a custom calendar using Power Query in Power BI is a common
and essential task when dealing with date-related data, especially for
performing time-based analysis like year-over-year (YoY), month-to-date
(MTD), and quarter-to-date (QTD) comparisons. Having a custom date
table ensures that you have control over the format, date ranges, and any
specific time-based logic needed for your reports.
2. CREATE CUSTOM CALENDAR IN POWER
QUERY
M Code
let
// Define start and end dates for the calendar
StartDate = #date(2020, 1, 1), // You can change this to your desired start date
EndDate = Date.From(DateTime.LocalNow()), // Automatically takes today's date as the end
date
// Generate a list of dates between the start and end dates
DateList = List.Dates(StartDate, Duration.Days(EndDate - StartDate) + 1, #duration(1, 0, 0,
0)),
// Convert the list into a table
DateTable = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}, null,
ExtraValues.Error),
// Add Year, Month, and Day columns for further analysis
AddYear = Table.AddColumn(DateTable, "Year", each Date.Year([Date]),
Int64.Type), AddMonth = Table.AddColumn(AddYear, "Month", each
Date.Month([Date]), Int64.Type), AddDay = Table.AddColumn(AddMonth, "Day",
each Date.Day([Date]), Int64.Type),
AddMonthName = Table.AddColumn(AddDay, "Month Name", each
Date.ToText([Date], "MMMM"), type text),
AddQuarter = Table.AddColumn(AddMonthName, "Quarter", each
Date.QuarterOfYear([Date]), Int64.Type),
AddYearMonth = Table.AddColumn(AddQuarter, "Year-Month", each Date.ToText([Date], "yyyy-
MM"), type text),
AddWeekOfYear = Table.AddColumn(AddYearMonth, "Week of Year", each
Date.WeekOfYear([Date]), Int64.Type),
AddDayOfWeek = Table.AddColumn(AddWeekOfYear, "Day of Week", each Date.ToText([Date],
"dddd"), type text),
3 . CALENDAR DAX FORMULA
Formula
= CALENDAR(MIN(SalesData[Date]),MAX(SalesData[Date]))
The CALENDAR DAX function in Power BI is used to generate a
continuous range of dates between a specified start and end date. It's
particularly useful when building a date table, which is essential for
time-based calculations such as year-over-year analysis, month-to-date,
quarter-to- date, etc.
4 . CALENDARAUTO DAX FORMULA
Formula
= CALENDARAUTO()
The CALENDARAUTO function in Power BI is a powerful tool for creating
a date table that automatically detects the date range from all date
columns in your data model. This means it scans your data and
generates a date range based on the minimum and maximum dates
found in the model, which is especially helpful for dynamic date tables
without specifying start or end dates manually.
MTD QTD AND YTD DAX FORMULA
Sales MTD = TOTALMTD(SUM(Sales[SalesAmount]
),
DateTable[Date]
)
Sales QTD = TOTALQTD(SUM(Sales[SalesAmount]
),
DateTable[Date]
)
Sales YTD = TOTALYTD(SUM(Sales[SalesAmount]
),
DateTable[Date]
)
Formula
MTD (Month-to-Date), QTD (Quarter-to-Date), and YTD (Year-to-Date) are
commonly used DAX functions in Power BI for performing time-based
aggregations. They are particularly helpful for tracking progress over the
current month, quarter, or year
, making it easy to see cumulative totals
up to the present date. These functions rely on having a properly
structured date table, ideally linked to your data model.
NETWORKDAYS DAX FORMULA
Network Days = NETWORKDAYS("01-01-2023","31-01-
2023",1,Holidays)
Formula
In Power BI, Network Days refers to the count of working days (typically
Monday through Friday) between two specified dates, excluding
weekends and optionally excluding holidays.
NETWORKDAYS DAX FORMULA
Network Days = NETWORKDAYS("01-01-2023","31-01-
2023",1,Holidays)
1 or omitted: Saturday,
Sunday 2: Sunday, Monday
3: Monday, Tuesday
4: Tuesday, Wednesday
5: Wednesday, Thursday
6: Thursday, Friday
7: Friday, Saturday
11: Sunday only
12: Monday only
13: Tuesday only
14: Wednesday only
15: Thursday only
16: Friday only
17: Saturday only
DATESINPERIOD DAX FORMULA
DATESINPERIOD(<dates>, <start_date>, <number_of_intervals>,
<interval>)
Formula
The DATESINPERIOD function in DAX returns a single-column table of
dates within a specified period, based on a start date and a defined
interval. It’s useful when you need to create calculations over dynamic
date ranges (e.g., last 7 days, previous month, etc.).
DATESBETWEEN DAX FORMULA
DATESBETWEEN(<dates>, <start_date>,
<end_date>)
Formula
The DATESBETWEEN function in DAX returns a table with dates within a
specified start and end date range. This function is useful when you want
to filter data to specific date boundaries.
CALCULATE DAX FORMULA
SAMEPERIODLASTYEAR(<dates
>)
Formula
The SAMEPERIODLASTYEAR function in DAX is used to return a table
with the dates for the same period in the previous year
. This function is
often used in time intelligence calculations to compare current
performance to the previous year.
TEXT FORMULAS
In Power BI, there are several DAX functions designed for working with
text data. These functions allow you to manipulate and format text
values in various ways. Here are some commonly used text DAX
formulas in Power BI:
LEFT
, RIGHT
, MID
LEFT("Power BI", 5) // Result:
"Power" RIGHT("Power BI", 2) //
Result: "BI" MID("Power BI", 7, 2) //
Result: "BI"
TEXT FORMULAS
In Power BI, there are several DAX functions designed for working with
text data. These functions allow you to manipulate and format text
values in various ways. Here are some commonly used text DAX
formulas in Power BI:
UPPER and LOWER
UPPER("Power BI") // Result: "POWER
BI" LOWER("Power BI") // Result:
"power bi"
LEN: Returns the length (number of characters) of a
text string.

More Related Content

PPTX
Power BI DAX Formula s dsfnv oid soio f bofb ewowo weubbuoebfouobi goweie
PPTX
Power BI DAX Formula lksjdvhsdu osdhf fhohd hiohhs ogoi shfou
PPTX
DAX Formulas Notes and examples learning
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
PDF
2024 State of Marketing Report – by Hubspot
Power BI DAX Formula s dsfnv oid soio f bofb ewowo weubbuoebfouobi goweie
Power BI DAX Formula lksjdvhsdu osdhf fhohd hiohhs ogoi shfou
DAX Formulas Notes and examples learning
2024 Trend Updates: What Really Works In SEO & Content Marketing
Storytelling For The Web: Integrate Storytelling in your Design Process
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
2024 State of Marketing Report – by Hubspot

Recently uploaded (20)

PDF
Dominate the Explore Page Level Me Up...
PPTX
Best Web Development Company in Lucknow.pptx
PDF
Why AI-Savvy Freelance Digital Marketers Have a Competitive Edge!.pdf
PDF
Faculty of E languageTruongMinhThien.pdf
PPTX
Unlock Your Business’s Full Online Potential
PDF
IDM UltraCompare Professional 24.1.0.5 Crack
PDF
People in Delhi call cheerful girls for celebrations
PPTX
Download_HitPaw Video Converter Crack free
PDF
49f97d4d-be4b-40d1-88f7-06f1460c2238.pdf
PDF
The Effect of Internships on Career Preparedness as Perceived by Criminology ...
PDF
Presentation-Popular-Culture-in-the-Philippines.pdf
PPTX
Mindfulness_and_Coping_Workshop in workplace
PPTX
Philippine-Pop-Culture.pptx.hhtps.com.ph
PDF
Organizational Culture and Leadership Style as Predictors of Organizational C...
PDF
What is TikTok Cyberbullying_ 15 Smart Ways to Prevent It.pdf
PDF
Implementation of Total Quality Management (TQM) in Plywood Production Contro...
PDF
Why Blend In When You Can Trend? Make Me Trend
PDF
The Effect of Compensation and Work Environment on Employee Performance with ...
PDF
The Black Turn Best Music Distribution In India
PPTX
Smart Card Face Mask detection soluiondr
Dominate the Explore Page Level Me Up...
Best Web Development Company in Lucknow.pptx
Why AI-Savvy Freelance Digital Marketers Have a Competitive Edge!.pdf
Faculty of E languageTruongMinhThien.pdf
Unlock Your Business’s Full Online Potential
IDM UltraCompare Professional 24.1.0.5 Crack
People in Delhi call cheerful girls for celebrations
Download_HitPaw Video Converter Crack free
49f97d4d-be4b-40d1-88f7-06f1460c2238.pdf
The Effect of Internships on Career Preparedness as Perceived by Criminology ...
Presentation-Popular-Culture-in-the-Philippines.pdf
Mindfulness_and_Coping_Workshop in workplace
Philippine-Pop-Culture.pptx.hhtps.com.ph
Organizational Culture and Leadership Style as Predictors of Organizational C...
What is TikTok Cyberbullying_ 15 Smart Ways to Prevent It.pdf
Implementation of Total Quality Management (TQM) in Plywood Production Contro...
Why Blend In When You Can Trend? Make Me Trend
The Effect of Compensation and Work Environment on Employee Performance with ...
The Black Turn Best Music Distribution In India
Smart Card Face Mask detection soluiondr
Ad
Ad

Power BI DAX Formulas and fast easy technical learning

  • 1. SUM FORMULA IN POWER BI Definition: SUM is a simple aggregation function that adds up all the values in a single column. Example Total_Sales = SUM(SalesData[Sales]) Use Case: Use SUM when you want to sum up all the values in a numeric column without any complex row-by-row operations. Performance: Since it operates directly on a column, it's fast and efficient for simple summations.
  • 2. CALCULATED COLUMN IN POWER BI Definition: A calculated column is a new column that you create in a table using DAX (Data Analysis Expressions). The value for each row is calculated when the column is created, and it remains static unless the data is refreshed. Example Tax = SalesData[Total_Sales]*18/100 Use Cases: Suitable for scenarios where you need a value for each row in the table, such as adding a new field derived from existing data (e.g., creating a "Total Price" column by multiplying "Quantity" and "Price"). Performance: Since calculated columns are stored in the model,
  • 5. DIFFERENCE BETWEEN CALCULATED COLUMN AND MEASURE IN POWER BI In Power BI, both calculated columns and measures are used to perform calculations, but they serve different purposes and behave differently. Here's a comparison of the two:
  • 7. SUMX FORMULA IN POWER BI Definition: SUMX is an iterator function that performs row-by- row calculations and then sums the results. Example Total_Sales2 = SUMX(SalesData,SalesData[Quantity]*SalesData[Unit Price (INR)]) Use Case: Use SUMX when you need to perform a calculation for each row before summing, such as multiplying two columns together or applying conditional logic. Performance: SUMX can be slower than SUM because it performs calculations on each row individually before summing. It's ideal for more complex scenarios that require row context.
  • 8. DIFFERENCE BETWEEN SUM AND SUMX FORMULA IN POWER BI In Power BI, both SUM and SUMX are used to perform summation, but they work differently and are used in different scenarios. Here's a breakdown of the key differences:
  • 10. COUNT FORMULA IN POWER BI •Definition: COUNT counts the number of non-blank values in a column. •Example •Number of Customers = COUNT('Table'[Customer ID]) Use Case: When you want to count the non-empty values in a column.
  • 12. COUNTA FORMULA IN POWER BI Definition: COUNTA counts the number of non-blank values in a column, including text, numeric values, and logical values even counts Boolean values where only Count will not count Boolean data type Example Number of Reviews = COUNTA('Table'[Review Status]) Use Case: When you need to count all non-blank values, regardless of the data type (text, numbers, etc.).
  • 14. COUNTBLANK FORMULA IN POWER BI •Definition: COUNTBLANK counts the number of blank (empty) values in a column. •Example •Blank Reveiws = COUNTBLANK('Table'[Review Points]) Use Case: When you want to count the number of blank or missing values in a column.
  • 16. COUNTROWS FORMULA IN POWER BI Definition: COUNTROWS counts the number of rows in a table. Example Total Records = COUNTROWS('Table') Use Case: When you want to count the total number of rows in a table or in a filtered table.
  • 18. DISTINCTCOUNT FORMULA •Definition: DISTINCTCOUNT counts the number of unique, non-blank values in a column. •Example •Unique States = DISTINCTCOUNT('Table'[State]) Use Case: When you need to count the distinct (unique) values in a column, excluding blanks.
  • 20. COUNTX FORMULA Definition: COUNTX is an iterator function that counts non-blank results of an expression evaluated row by row over a table. Example Count Reviews >= 5 = COUNTX('Table', IF('Table'[Review Points] >= 5, 1, BLANK())) Use Case: When you need to count based on an expression that is evaluated for each row in a table.
  • 22. COUNTAX FORMULA Definition: COUNTAX is the iterator version of COUNTA. It evaluates an expression for each row and counts the number of non-blank results. Example Count True = COUNTAX(FILTER('Table','Table'[Review Status]=true),'Table'[Review Status]) Use Case: When you need to count based on an expression that is evaluated for each row in a table even there is Binary data type.
  • 24. COUNTROWS WITH FILTER FORMULA •Definition: COUNTROWS can be used with the FILTER function to count rows that meet specific criteria. •Example •Maharashtra Count = COUNTROWS(FILTER('Table','Table'[State]="Maharashtra")) Use Case: When you want to count rows based on a condition or set of conditions.
  • 25. SUMMARY OF DAX COUNTING FUNCTIONS: These functions provide flexibility depending on whether you're counting all rows, distinct values, non-blank values, or values based on expressions and conditions.
  • 28. EXTRACT DAY/MONTH/YEAR DAY(<datetime>) : Extracts the day from a date value. MONTH(<datetime>) : Extracts the month from a date value. YEAR(<datetime>) : Extracts the year from a date value.
  • 29. EXTRACT HOUR/MINUTE/SECOND Hour(<datetime>) : Extracts the Hour from a date and time value. Minute(<datetime>) : Extracts the Minute from a date and time value. Second(<datetime>) : Extracts the Second from a date and time value.
  • 30. EXTRACT HOUR/MINUTE/SECOND Today() : Show Current date Now() – Show current date and Time Weekday() – Show Weekday in numbers between 1 to 7 Weeknum() – Show Week number in Month/Year
  • 31. DATEDIFF FORMULA Definition: Returns the difference between two dates in the specified interval (days, months, years, etc.). Syntax DATEDIFF(<start_date>, <end_date>, <interval>) Example DATEDIFF(Sales[OrderDate], Sales[ShipDate], DAY)
  • 33. 1 . CREATE CUSTOM CALENDAR IN POWER QUERY Formula = List.Dates(#date(2023,1,1),731,#duration(1,0,0,0)) Creating a custom calendar using Power Query in Power BI is a common and essential task when dealing with date-related data, especially for performing time-based analysis like year-over-year (YoY), month-to-date (MTD), and quarter-to-date (QTD) comparisons. Having a custom date table ensures that you have control over the format, date ranges, and any specific time-based logic needed for your reports.
  • 34. 2. CREATE CUSTOM CALENDAR IN POWER QUERY M Code let // Define start and end dates for the calendar StartDate = #date(2020, 1, 1), // You can change this to your desired start date EndDate = Date.From(DateTime.LocalNow()), // Automatically takes today's date as the end date // Generate a list of dates between the start and end dates DateList = List.Dates(StartDate, Duration.Days(EndDate - StartDate) + 1, #duration(1, 0, 0, 0)), // Convert the list into a table DateTable = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error), // Add Year, Month, and Day columns for further analysis AddYear = Table.AddColumn(DateTable, "Year", each Date.Year([Date]), Int64.Type), AddMonth = Table.AddColumn(AddYear, "Month", each Date.Month([Date]), Int64.Type), AddDay = Table.AddColumn(AddMonth, "Day", each Date.Day([Date]), Int64.Type), AddMonthName = Table.AddColumn(AddDay, "Month Name", each Date.ToText([Date], "MMMM"), type text), AddQuarter = Table.AddColumn(AddMonthName, "Quarter", each Date.QuarterOfYear([Date]), Int64.Type), AddYearMonth = Table.AddColumn(AddQuarter, "Year-Month", each Date.ToText([Date], "yyyy- MM"), type text), AddWeekOfYear = Table.AddColumn(AddYearMonth, "Week of Year", each Date.WeekOfYear([Date]), Int64.Type), AddDayOfWeek = Table.AddColumn(AddWeekOfYear, "Day of Week", each Date.ToText([Date], "dddd"), type text),
  • 35. 3 . CALENDAR DAX FORMULA Formula = CALENDAR(MIN(SalesData[Date]),MAX(SalesData[Date])) The CALENDAR DAX function in Power BI is used to generate a continuous range of dates between a specified start and end date. It's particularly useful when building a date table, which is essential for time-based calculations such as year-over-year analysis, month-to-date, quarter-to- date, etc.
  • 36. 4 . CALENDARAUTO DAX FORMULA Formula = CALENDARAUTO() The CALENDARAUTO function in Power BI is a powerful tool for creating a date table that automatically detects the date range from all date columns in your data model. This means it scans your data and generates a date range based on the minimum and maximum dates found in the model, which is especially helpful for dynamic date tables without specifying start or end dates manually.
  • 37. MTD QTD AND YTD DAX FORMULA Sales MTD = TOTALMTD(SUM(Sales[SalesAmount] ), DateTable[Date] ) Sales QTD = TOTALQTD(SUM(Sales[SalesAmount] ), DateTable[Date] ) Sales YTD = TOTALYTD(SUM(Sales[SalesAmount] ), DateTable[Date] ) Formula MTD (Month-to-Date), QTD (Quarter-to-Date), and YTD (Year-to-Date) are commonly used DAX functions in Power BI for performing time-based aggregations. They are particularly helpful for tracking progress over the current month, quarter, or year , making it easy to see cumulative totals up to the present date. These functions rely on having a properly structured date table, ideally linked to your data model.
  • 38. NETWORKDAYS DAX FORMULA Network Days = NETWORKDAYS("01-01-2023","31-01- 2023",1,Holidays) Formula In Power BI, Network Days refers to the count of working days (typically Monday through Friday) between two specified dates, excluding weekends and optionally excluding holidays.
  • 39. NETWORKDAYS DAX FORMULA Network Days = NETWORKDAYS("01-01-2023","31-01- 2023",1,Holidays) 1 or omitted: Saturday, Sunday 2: Sunday, Monday 3: Monday, Tuesday 4: Tuesday, Wednesday 5: Wednesday, Thursday 6: Thursday, Friday 7: Friday, Saturday 11: Sunday only 12: Monday only 13: Tuesday only 14: Wednesday only 15: Thursday only 16: Friday only 17: Saturday only
  • 40. DATESINPERIOD DAX FORMULA DATESINPERIOD(<dates>, <start_date>, <number_of_intervals>, <interval>) Formula The DATESINPERIOD function in DAX returns a single-column table of dates within a specified period, based on a start date and a defined interval. It’s useful when you need to create calculations over dynamic date ranges (e.g., last 7 days, previous month, etc.).
  • 41. DATESBETWEEN DAX FORMULA DATESBETWEEN(<dates>, <start_date>, <end_date>) Formula The DATESBETWEEN function in DAX returns a table with dates within a specified start and end date range. This function is useful when you want to filter data to specific date boundaries.
  • 42. CALCULATE DAX FORMULA SAMEPERIODLASTYEAR(<dates >) Formula The SAMEPERIODLASTYEAR function in DAX is used to return a table with the dates for the same period in the previous year . This function is often used in time intelligence calculations to compare current performance to the previous year.
  • 43. TEXT FORMULAS In Power BI, there are several DAX functions designed for working with text data. These functions allow you to manipulate and format text values in various ways. Here are some commonly used text DAX formulas in Power BI: LEFT , RIGHT , MID LEFT("Power BI", 5) // Result: "Power" RIGHT("Power BI", 2) // Result: "BI" MID("Power BI", 7, 2) // Result: "BI"
  • 44. TEXT FORMULAS In Power BI, there are several DAX functions designed for working with text data. These functions allow you to manipulate and format text values in various ways. Here are some commonly used text DAX formulas in Power BI: UPPER and LOWER UPPER("Power BI") // Result: "POWER BI" LOWER("Power BI") // Result: "power bi" LEN: Returns the length (number of characters) of a text string.