SlideShare ist ein Scribd-Unternehmen logo
1 von 41
DAX Level 4
YTD
March
YTD
March
YTD
March
CALCULATE() with ALL() and FILTER()
2 Types of Filters:
Simple Filters & Advanced Filters
CALCULATE([measure], <filter1>, <filter2>, … <filterN>)
2 Types of Filters:
Simple Filters & Advanced Filters
CALCULATE([measure], <filter1>, <filter2>, … <filterN>)
ALL()
ALL('table' or 'table'[column])
#1 - Pick a cell in the pivot
#1 - Pick a cell in the pivot
#2 – Got DAX Filters?
Sales All Customers = CALCULATE([Sales],ALL('Customers'))
Sales All Customers = CALCULATE([Sales],ALL('Customers'))
Sales All Customers = CALCULATE([Sales],ALL('Customers'))
Sales All Customers = CALCULATE([Sales],ALL('Customers'))
#3 - Picture filters reducing data in
the model
#4 - After filtering, apply math
#4 - After filtering, apply math
#4 - After filtering, apply math
ALL()
Qty % of Vendors
FILTER()
FILTER('table',<any filter>)
FILTER()
Non-Diversified Suppliers
ALL() and FILTER()
ALL() and FILTER()
On Contract YTD
On Contract LYTD
DAX Formatter
http://www.daxformatter.com/
Tip - DAX Step through formula
Sales YTD :=
CALCULATE (
[Sales],
FILTER (
ALL ( 'Calendar' ),
AND (
Calendar[Year] = MAX ( Calendar[Year] ),
Calendar[Date] <= MAX ( Calendar[Date] )
)
)
)
Sales YTD :=
CALCULATE (
[Sales],
FILTER (
,
AND (
Calendar[Year] = MAX ( Calendar[Year] ),
Calendar[Date] <= MAX ( Calendar[Date] )
)
)
)
Date Year
1/1/2014 2014
1/2/2014 2014
… …
12/30/2018 2018
12/31/2018 2018
Sales YTD :=
CALCULATE (
[Sales],
FILTER (
,
AND (
Calendar[Year] = 2016,
Calendar[Date] <= “2/29/2016”
)
)
)
Date Year
1/1/2014 2014
1/2/2014 2014
… …
12/30/2018 2018
12/31/2018 2018
Sales YTD :=
CALCULATE (
[Sales],
FILTER (
,
AND (
True,
True
)
)
)
Date Year
1/1/2014 2014
1/2/2014 2014
… …
12/30/2018 2018
12/31/2018 2018
Sales YTD :=
CALCULATE (
[Sales],
FILTER (
,
True
)
)
)
Date Year
1/1/2014 2014
1/2/2014 2014
… …
12/30/2018 2018
12/31/2018 2018
Sales YTD :=
CALCULATE (
[Sales],
)
Date Year
1/1/2016 2016
1/2/2016 2016
… …
2/28/2016 2016
2/29/2016 2016
Sales YTD :=
CALCULATE (
[Sales],
)
Date Year
1/1/2016 2016
1/2/2016 2016
… …
2/28/2016 2016
2/29/2016 2016
Filter the Sales table through
relationship in the model.
Brand Customer Item Division Requested Ship Date Gross Line Amount
Brand 8 Customer 2 Item No 350 Division 2 1/1/2014 5.49
Brand 8 Customer 2 Item No 350 Division 2 1/2/2014 7.37
… … … … … …
Brand 8 Customer 2 Item No 350 Division 2 4/23/2016 8.45
Brand 8 Customer 2 Item No 350 Division 2 4/24/2016 3.45
Sales YTD :=
$9,779,779
Brand Customer Item Division Requested Ship Date Gross Line Amount
Brand 8 Customer 2 Item No 350 Division 2 1/1/2016 3.56
Brand 8 Customer 2 Item No 350 Division 2 1/2/2016 5.07
… … … … … …
Brand 8 Customer 2 Item No 350 Division 2 2/28/2016 4.22
Brand 8 Customer 2 Item No 350 Division 2 2/29/2016 5.8
Do the math and return the value
to the cell in the pivot table.
Exercise
• ALL()
• Qty % of Vendors
• FILTER()
• Non-Diversified Suppliers
• ALL() and FILTER()
• On Contract YTD
• On Contract LYTD
DAX Books
Homework
• Finish creating metrics
• Explore a real world dataset with Power Query
• Practice your transformation skills by turning the data into
something useful
• Share your Power Query experience with Steve
Next Week
• Beginner Power Pivot
• Logical Functions IF() and SWITCH()
• Time Intelligence Functions
• Budget vs Actual or Benchmark vs Actual

Weitere ähnliche Inhalte

Andere mochten auch

DAX and Power BI Training - 001 Overview
DAX and Power BI Training -  001 OverviewDAX and Power BI Training -  001 Overview
DAX and Power BI Training - 001 OverviewWill Harvey
 
DAX and Power BI Training - 003 Beginner Power BI Reports
DAX and Power BI Training - 003 Beginner Power BI ReportsDAX and Power BI Training - 003 Beginner Power BI Reports
DAX and Power BI Training - 003 Beginner Power BI ReportsWill Harvey
 
DAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power QueryDAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power QueryWill Harvey
 
Introduction to DAX - Part 1
Introduction to DAX - Part 1Introduction to DAX - Part 1
Introduction to DAX - Part 1Alan Koo
 
マイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できること
マイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できることマイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できること
マイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できることDaisuke Masubuchi
 

Andere mochten auch (6)

DAX and Power BI Training - 001 Overview
DAX and Power BI Training -  001 OverviewDAX and Power BI Training -  001 Overview
DAX and Power BI Training - 001 Overview
 
DAX and Power BI Training - 003 Beginner Power BI Reports
DAX and Power BI Training - 003 Beginner Power BI ReportsDAX and Power BI Training - 003 Beginner Power BI Reports
DAX and Power BI Training - 003 Beginner Power BI Reports
 
DAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power QueryDAX and Power BI Training - 004 Power Query
DAX and Power BI Training - 004 Power Query
 
DAX (Data Analysis eXpressions) from Zero to Hero
DAX (Data Analysis eXpressions) from Zero to HeroDAX (Data Analysis eXpressions) from Zero to Hero
DAX (Data Analysis eXpressions) from Zero to Hero
 
Introduction to DAX - Part 1
Introduction to DAX - Part 1Introduction to DAX - Part 1
Introduction to DAX - Part 1
 
マイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できること
マイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できることマイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できること
マイクロソフトにおけるオープンソース戦略 ソフトウェア開発者が実現できること
 

Ähnlich wie DAX and Power BI Training - 005 DAX Level 4

Complete Resource for Consulting Frameworks and Design Templates
Complete Resource for Consulting Frameworks and Design TemplatesComplete Resource for Consulting Frameworks and Design Templates
Complete Resource for Consulting Frameworks and Design TemplatesFlevy.com Best Practices
 
Consultas avanzadas con GXquery 4.0
Consultas avanzadas con GXquery 4.0Consultas avanzadas con GXquery 4.0
Consultas avanzadas con GXquery 4.0GeneXus
 
Problem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docxProblem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docxChantellPantoja184
 
Mgt4059 advanced operations management complete course
Mgt4059 advanced operations management   complete courseMgt4059 advanced operations management   complete course
Mgt4059 advanced operations management complete coursehomeworkecrater
 
Economics class 12th
Economics class 12thEconomics class 12th
Economics class 12thmrriteshavhad
 
The Cube - Class XII Project
The Cube - Class XII ProjectThe Cube - Class XII Project
The Cube - Class XII ProjectNeil Mathew
 
Start-up Financial Forecasting
Start-up Financial ForecastingStart-up Financial Forecasting
Start-up Financial ForecastingEric Tachibana
 
Devry bis 155 final exams
Devry bis 155 final examsDevry bis 155 final exams
Devry bis 155 final examsshyaminfo104
 
FP304 DATABASE SYSTEM FINAL PAPER
FP304    DATABASE SYSTEM FINAL PAPERFP304    DATABASE SYSTEM FINAL PAPER
FP304 DATABASE SYSTEM FINAL PAPERSyahriha Ruslan
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & ChartsMS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Chartsdnbakhan
 
Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)filippo cheli
 
Revenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docx
Revenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docxRevenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docx
Revenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docxronak56
 
Introduction to CATIA (KEY) - CAD/CAM
Introduction to CATIA (KEY) - CAD/CAMIntroduction to CATIA (KEY) - CAD/CAM
Introduction to CATIA (KEY) - CAD/CAMSisubalan Selvan
 
Bis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-newBis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-newassignmentcloud85
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lovMilind Patil
 

Ähnlich wie DAX and Power BI Training - 005 DAX Level 4 (20)

Complete Resource for Consulting Frameworks and Design Templates
Complete Resource for Consulting Frameworks and Design TemplatesComplete Resource for Consulting Frameworks and Design Templates
Complete Resource for Consulting Frameworks and Design Templates
 
Consultas avanzadas con GXquery 4.0
Consultas avanzadas con GXquery 4.0Consultas avanzadas con GXquery 4.0
Consultas avanzadas con GXquery 4.0
 
Problem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docxProblem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docx
 
Mgt4059 advanced operations management complete course
Mgt4059 advanced operations management   complete courseMgt4059 advanced operations management   complete course
Mgt4059 advanced operations management complete course
 
Economics class 12th
Economics class 12thEconomics class 12th
Economics class 12th
 
DW-lecture2.ppt
DW-lecture2.pptDW-lecture2.ppt
DW-lecture2.ppt
 
Marketing game
Marketing gameMarketing game
Marketing game
 
The Cube - Class XII Project
The Cube - Class XII ProjectThe Cube - Class XII Project
The Cube - Class XII Project
 
Start-up Financial Forecasting
Start-up Financial ForecastingStart-up Financial Forecasting
Start-up Financial Forecasting
 
Devry bis 155 final exams
Devry bis 155 final examsDevry bis 155 final exams
Devry bis 155 final exams
 
FP304 DATABASE SYSTEM FINAL PAPER
FP304    DATABASE SYSTEM FINAL PAPERFP304    DATABASE SYSTEM FINAL PAPER
FP304 DATABASE SYSTEM FINAL PAPER
 
Group 9
Group 9Group 9
Group 9
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & ChartsMS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Charts
 
Bosch Highlights
Bosch HighlightsBosch Highlights
Bosch Highlights
 
Iowa liquor sales
Iowa liquor salesIowa liquor sales
Iowa liquor sales
 
Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)Business game - Polimi (three-year bachelor thesis)
Business game - Polimi (three-year bachelor thesis)
 
Revenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docx
Revenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docxRevenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docx
Revenue by DepartmentBlue Lake SportsFirst Quarter Sales by CityDe.docx
 
Introduction to CATIA (KEY) - CAD/CAM
Introduction to CATIA (KEY) - CAD/CAMIntroduction to CATIA (KEY) - CAD/CAM
Introduction to CATIA (KEY) - CAD/CAM
 
Bis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-newBis 345-final-exam-guide-set-1-new
Bis 345-final-exam-guide-set-1-new
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
 

Kürzlich hochgeladen

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Kürzlich hochgeladen (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

DAX and Power BI Training - 005 DAX Level 4