SlideShare a Scribd company logo
1 of 9
Download to read offline
QN1: Find out No of Employees belongs to Analyst Department
Method -1
Count of Employees = calculate(count(Employee[Department]), Filter(‘Employee’,
Employee[Department]=”Analyst Department”))
Method -2
Count of Employees = calculate(countx(Employee, Employee [Department]), Filter(‘Employee’,
Employee[Department]=”Analyst Department”))
QN2: Create a table with Two columns Department name and avg Sal
Method -1
= SUMMARIZECOLUMNS(Employee[DepartmentName], Employee[AvgSal])
QN3: Need a count of Employees whose salary is greater than average salary of department of Analyst
Method -1
countofEmployees=calculate(count(Employee[Empid]),Filter(Employee[Department]=”Analyst”),Filter(Employe
e[Sal]>Average(Employee[Sal])))
Method -2
countofEmployees=calculate(countx(Employee, Employee
[Empid]),Filter(Employee[Department]=”Analyst”),Filter(Employee[Sal]>Average(Employee[Sal])))
QNO 5: Difference between Sum And Sumx
Sum and sumx will be performing on aggregation operations the both the functions will allows the filters also
but in SumX we can write a aggregations on expressions like
Netamount = SUMX(ALL(Data),Data[SalesAmount]-Data[TaxAmt])
QN: YOY And MOM
YOY:
totalSales= sum(Tablename[Sales])
PreviousYs= calculate(sum(tablename[Sales]),previousyear(tablename[Sales]))
YOY= (Totalsales-PreviousYS)/[PreviousYS]
MOM:
totalSales= sum(Tablename[Sales])
PreviousMs= calculate(sum(tablename[Sales]),previousMonth(tablename[Sales]))
MOM= (Totalsales-PreviousMS)/[PreviousMS]
QN: What are the ways to delete duplicate rows
1. By Distinct operatore
2. By using Row_number() with the CTE
QN: what is CTE? And it’s difference between cte and temp table?
CTE:
CTE (Common Table expression) can be thought of as a temporary result set that is defined within the
execution scope of a single select, insert, update,delete or createview statement.
Cte can be self-referencing and can be referenced multiple times in the same query.
Cte we can use with in the query itself.
Temp table:
Temp table also used for to store the result of query on temporary basis. But we can able to use with in
the current session it is defined by #
QN: Differenct connectivity modes? Can we create measures in Direct mode and live connection?
3 types of modes we have
1. Import Mode
2. Direct Mode
3. Live Connection
Yes we can create the measures in Direct mode and live connection
QN: Difference ways to share the report?
Mainly we have 3 types:
App.Power BI .com
Content Pack.
Reporting Server
Additionally we have below methods:
1. Publish to Web
2. Embed in Web
3. Embeded in sharepoint online
4. Export to Excel
5. Export to Template
QN: Different types of roles what kind of roles we can provide?
We have a manage roles option, under this option we can create two type of roles
Dynamic roles and Statistical roles
In workspace majorly we will use Statistical roles
QN: Selected measure with Dynamically
Selectedmfeasure = SWITCH(true,
SELECTEDVALUE(Data[Color])="Black",FORMAT(SUM(Data[SalesAmount]),"0"),
SELECTEDVALUE(Data[Color])="Multi",FORMAT(SUM(Data[SalesAmount]),"0"),
SELECTEDVALUE(Data[Color])="Red",FORMAT(SUM(Data[SalesAmount]),"0"),
selectedvalue(Data[Color])="Silver",FORMAT(SUM(Data[SalesAmount]),"0"),
SELECTEDVALUE(Data[Color])="Balnk",FORMAT(SUM(Data[SalesAmount]),"0"))
QN: we need to create two columns based on existing column firstname.lastname@gmail.com like
firstname and lastname
For Firstname:
Left(Text, Search(Findtext, withintext,Startposition, Notfoundvalue)
Example:
Left(firstname.lastname@gmail.com ,Search(“.”,firstname.lastname@gmail.com ,1,0)-1)
Result: firstname
Mid:
MID(Sheet1[Column1],SEARCH(".",Sheet1[Column1])+1,FIND("@",Sheet1[Column1])-
SEARCH(".",Sheet1[Column1])-1)
QNO:find out who r the users visited more than once in the below table
with cte
as(
select distinct orderid,customerid from orders
)
select customerid, count(*) from CTE
group by customerid
having count(*)>1
Method2: select customerid, count(*) from(
select distinct orderid,customerid from orders
) Orders
group by customerid
having count(*)>1
QNO: Top 5 cities Sales amount has to display
Sum = Sum(Salesamount)
Rankx = Rankx( All (Data[city]),[ Sum], , Dsc, Skip)
IF(ISFILTERED(Data[City]),IF([Rankx]<=5, [Sum],
BLANK()),CALCULATE([Sum],TOPN(5,VALUES(Data[City]),[Sum])))
1. TotalMTD:
2. TotalYTD
3. SameperiodLastyear
4. If:
Checks if a condition provided as the first argument is met. Returns one value if the condition is TRUE, and
returns another value if the condition is FALSE.
5. Sign:
Returns the sign of a number: 1 if the number is positive, zero if the number is zero, or -1 if the number is
negative.
6.Replace:
REPLACE replaces part of a text string, based on the number of characters you specify, with a different text
string.
Syntax:
REPLACE(Sheet1[Column1],1,2,"vasu")
7 convert:
Converts an expression of one data type to another.
Syntax:
CONVERT(<Expression>, <Datatype>)
convert = CONVERT(DATE(2020,3,2),integer)8. Datediff
9. Timevalue:
Converts a time in text formate to a time in date time formate.
Time value(Text time)
convert = CONVERT(DATE(2020,3,2),integer)
10. WeekDay:
11. DatesBetween
12. DatesinPeriod
13. firstnonblank
14. parallelperiod
15. sameperiodlastyear
16. TotalQTD
17. allexcept:
18. calculate
19. distinct
20. crossfilter
21. related
22. userelationship
23. contains
24. iserror
25. islogical
26. Naturalinnerjoin
27.Naturalleftjoin
28.Union
29. pathcontains
30. PAthitem
31.crossjoin
32. distinctcount
33. concatenate
34. concatenatex
35. find
36. search
37. lookup
38.lookupvalue
39.and
40.iferror
41.switch
42. ceiling
43.divide
44. sum
45. sumx
46. except
47. search
48. substitute
49. count
50. distinctcount
51. countblank
53.CountAX
Findout the Aging and bucketing
Agingcountoforders =
CALCULATE(COUNTROWS(Orders),
FILTER(Orders,
COUNTROWS(FILTER(Aging,DATEDIFF(Orders[Order Date],TODAY(),DAY)>= Aging[Min]&&
DATEDIFF(Orders[Order Date],TODAY(),DAY)<=Aging[Max]))>0))
How findout current year sales and previous year sales dynamically
Current YearSales = CALCULATE(SUM(Orders[Sales]),YEAR(dimdate[Date])=YEAR(TODAY()) )
Previous YearSales = CALCULATE(SUM(Orders[Sales]),YEAR(dimdate[Date])=YEAR(TODAY()) -1)
How to Findout the TopN + others salary
rankswise = CALCULATE(SUM(Orders[Sales]),
FILTER(VALUES(Orders[Customer Name]),
COUNTROWS(FILTER('Grouping',[Rankx]>'Grouping'[Min] && [Rankx]<='Grouping'[Max]))>0))
(Or)
rankswise = CALCULATE(SUM(Orders[Sales]),
FILTER(VALUES(Orders[Customer Name]),
COUNTROWS(FILTER('Grouping',RANKX(ALL(Orders[CustomerName]),[TotalSales],,DESC)>='Grouping'[Min]
&& RANKX(ALL(Orders[Customer Name]),[TotalSales],,DESC)<='Grouping'[Max]))>0))
By Using Var calculating Forecast reports:
Dax queries.pdf

More Related Content

Similar to Dax queries.pdf

Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional arrayRajendran
 
Cubing and Metrics in SQL, oh my!
Cubing and Metrics in SQL, oh my!Cubing and Metrics in SQL, oh my!
Cubing and Metrics in SQL, oh my!Julian Hyde
 
NumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxNumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxJohnWilliam111370
 
12. Basic SQL Queries (2).pptx
12. Basic SQL Queries  (2).pptx12. Basic SQL Queries  (2).pptx
12. Basic SQL Queries (2).pptxSabrinaShanta2
 
Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017Parth Khare
 
Chris Seebacher Portfolio
Chris Seebacher PortfolioChris Seebacher Portfolio
Chris Seebacher Portfolioguest3ea163
 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationBoston Institute of Analytics
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and OperatorsMohan Kumar.R
 
Lecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structureLecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structureNurjahan Nipa
 

Similar to Dax queries.pdf (20)

Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
 
Cubing and Metrics in SQL, oh my!
Cubing and Metrics in SQL, oh my!Cubing and Metrics in SQL, oh my!
Cubing and Metrics in SQL, oh my!
 
NumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxNumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptx
 
12. Basic SQL Queries (2).pptx
12. Basic SQL Queries  (2).pptx12. Basic SQL Queries  (2).pptx
12. Basic SQL Queries (2).pptx
 
R for Statistical Computing
R for Statistical ComputingR for Statistical Computing
R for Statistical Computing
 
interenship.pptx
interenship.pptxinterenship.pptx
interenship.pptx
 
Basic Analysis using Python
Basic Analysis using PythonBasic Analysis using Python
Basic Analysis using Python
 
Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017
 
Chris Seebacher Portfolio
Chris Seebacher PortfolioChris Seebacher Portfolio
Chris Seebacher Portfolio
 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project Presentation
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 
R part I
R part IR part I
R part I
 
Excel Training
Excel TrainingExcel Training
Excel Training
 
Mdx basics
Mdx basicsMdx basics
Mdx basics
 
Mdx Basics
Mdx BasicsMdx Basics
Mdx Basics
 
Excel.useful fns
Excel.useful fnsExcel.useful fns
Excel.useful fns
 
Lecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structureLecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structure
 
07+08slide.pptx
07+08slide.pptx07+08slide.pptx
07+08slide.pptx
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
 

Recently uploaded

VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...Suhani Kapoor
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...Suhani Kapoor
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证obuhobo
 
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...Suhani Kapoor
 
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Niya Khan
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...gurkirankumar98700
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfSoham Mondal
 
Preventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxPreventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxGry Tina Tinde
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...Suhani Kapoor
 
VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...Suhani Kapoor
 
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
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjLewisJB
 
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big BoodyDubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boodykojalkojal131
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...Suhani Kapoor
 
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackVIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testspriyanshukumar97908
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...Suhani Kapoor
 
Call Girl in Low Price Delhi Punjabi Bagh 9711199012
Call Girl in Low Price Delhi Punjabi Bagh  9711199012Call Girl in Low Price Delhi Punjabi Bagh  9711199012
Call Girl in Low Price Delhi Punjabi Bagh 9711199012sapnasaifi408
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 

Recently uploaded (20)

VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
 
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
 
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
 
Preventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxPreventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptx
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
 
VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Cuttack Aishwarya 8250192130 Independent Escort Servic...
 
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
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbj
 
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big BoodyDubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
 
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackVIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
 
Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and tests
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
 
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
 
Call Girl in Low Price Delhi Punjabi Bagh 9711199012
Call Girl in Low Price Delhi Punjabi Bagh  9711199012Call Girl in Low Price Delhi Punjabi Bagh  9711199012
Call Girl in Low Price Delhi Punjabi Bagh 9711199012
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 

Dax queries.pdf

  • 1. QN1: Find out No of Employees belongs to Analyst Department Method -1 Count of Employees = calculate(count(Employee[Department]), Filter(‘Employee’, Employee[Department]=”Analyst Department”)) Method -2 Count of Employees = calculate(countx(Employee, Employee [Department]), Filter(‘Employee’, Employee[Department]=”Analyst Department”)) QN2: Create a table with Two columns Department name and avg Sal Method -1 = SUMMARIZECOLUMNS(Employee[DepartmentName], Employee[AvgSal]) QN3: Need a count of Employees whose salary is greater than average salary of department of Analyst Method -1 countofEmployees=calculate(count(Employee[Empid]),Filter(Employee[Department]=”Analyst”),Filter(Employe e[Sal]>Average(Employee[Sal]))) Method -2 countofEmployees=calculate(countx(Employee, Employee [Empid]),Filter(Employee[Department]=”Analyst”),Filter(Employee[Sal]>Average(Employee[Sal]))) QNO 5: Difference between Sum And Sumx Sum and sumx will be performing on aggregation operations the both the functions will allows the filters also but in SumX we can write a aggregations on expressions like Netamount = SUMX(ALL(Data),Data[SalesAmount]-Data[TaxAmt])
  • 2. QN: YOY And MOM YOY: totalSales= sum(Tablename[Sales]) PreviousYs= calculate(sum(tablename[Sales]),previousyear(tablename[Sales])) YOY= (Totalsales-PreviousYS)/[PreviousYS] MOM: totalSales= sum(Tablename[Sales]) PreviousMs= calculate(sum(tablename[Sales]),previousMonth(tablename[Sales])) MOM= (Totalsales-PreviousMS)/[PreviousMS] QN: What are the ways to delete duplicate rows 1. By Distinct operatore 2. By using Row_number() with the CTE QN: what is CTE? And it’s difference between cte and temp table? CTE: CTE (Common Table expression) can be thought of as a temporary result set that is defined within the execution scope of a single select, insert, update,delete or createview statement. Cte can be self-referencing and can be referenced multiple times in the same query. Cte we can use with in the query itself. Temp table: Temp table also used for to store the result of query on temporary basis. But we can able to use with in the current session it is defined by # QN: Differenct connectivity modes? Can we create measures in Direct mode and live connection? 3 types of modes we have 1. Import Mode 2. Direct Mode 3. Live Connection Yes we can create the measures in Direct mode and live connection
  • 3. QN: Difference ways to share the report? Mainly we have 3 types: App.Power BI .com Content Pack. Reporting Server Additionally we have below methods: 1. Publish to Web 2. Embed in Web 3. Embeded in sharepoint online 4. Export to Excel 5. Export to Template QN: Different types of roles what kind of roles we can provide? We have a manage roles option, under this option we can create two type of roles Dynamic roles and Statistical roles In workspace majorly we will use Statistical roles QN: Selected measure with Dynamically Selectedmfeasure = SWITCH(true, SELECTEDVALUE(Data[Color])="Black",FORMAT(SUM(Data[SalesAmount]),"0"), SELECTEDVALUE(Data[Color])="Multi",FORMAT(SUM(Data[SalesAmount]),"0"), SELECTEDVALUE(Data[Color])="Red",FORMAT(SUM(Data[SalesAmount]),"0"), selectedvalue(Data[Color])="Silver",FORMAT(SUM(Data[SalesAmount]),"0"), SELECTEDVALUE(Data[Color])="Balnk",FORMAT(SUM(Data[SalesAmount]),"0")) QN: we need to create two columns based on existing column firstname.lastname@gmail.com like firstname and lastname For Firstname: Left(Text, Search(Findtext, withintext,Startposition, Notfoundvalue) Example: Left(firstname.lastname@gmail.com ,Search(“.”,firstname.lastname@gmail.com ,1,0)-1) Result: firstname
  • 4. Mid: MID(Sheet1[Column1],SEARCH(".",Sheet1[Column1])+1,FIND("@",Sheet1[Column1])- SEARCH(".",Sheet1[Column1])-1) QNO:find out who r the users visited more than once in the below table with cte as( select distinct orderid,customerid from orders ) select customerid, count(*) from CTE group by customerid having count(*)>1 Method2: select customerid, count(*) from( select distinct orderid,customerid from orders ) Orders group by customerid having count(*)>1 QNO: Top 5 cities Sales amount has to display Sum = Sum(Salesamount) Rankx = Rankx( All (Data[city]),[ Sum], , Dsc, Skip) IF(ISFILTERED(Data[City]),IF([Rankx]<=5, [Sum], BLANK()),CALCULATE([Sum],TOPN(5,VALUES(Data[City]),[Sum]))) 1. TotalMTD: 2. TotalYTD 3. SameperiodLastyear
  • 5. 4. If: Checks if a condition provided as the first argument is met. Returns one value if the condition is TRUE, and returns another value if the condition is FALSE. 5. Sign: Returns the sign of a number: 1 if the number is positive, zero if the number is zero, or -1 if the number is negative. 6.Replace: REPLACE replaces part of a text string, based on the number of characters you specify, with a different text string. Syntax: REPLACE(Sheet1[Column1],1,2,"vasu") 7 convert: Converts an expression of one data type to another. Syntax: CONVERT(<Expression>, <Datatype>) convert = CONVERT(DATE(2020,3,2),integer)8. Datediff 9. Timevalue: Converts a time in text formate to a time in date time formate. Time value(Text time) convert = CONVERT(DATE(2020,3,2),integer) 10. WeekDay: 11. DatesBetween 12. DatesinPeriod 13. firstnonblank 14. parallelperiod 15. sameperiodlastyear 16. TotalQTD
  • 6. 17. allexcept: 18. calculate 19. distinct 20. crossfilter 21. related 22. userelationship 23. contains 24. iserror 25. islogical 26. Naturalinnerjoin 27.Naturalleftjoin 28.Union 29. pathcontains 30. PAthitem 31.crossjoin 32. distinctcount 33. concatenate 34. concatenatex 35. find 36. search 37. lookup 38.lookupvalue 39.and 40.iferror 41.switch
  • 7. 42. ceiling 43.divide 44. sum 45. sumx 46. except 47. search 48. substitute 49. count 50. distinctcount 51. countblank 53.CountAX Findout the Aging and bucketing Agingcountoforders = CALCULATE(COUNTROWS(Orders), FILTER(Orders, COUNTROWS(FILTER(Aging,DATEDIFF(Orders[Order Date],TODAY(),DAY)>= Aging[Min]&& DATEDIFF(Orders[Order Date],TODAY(),DAY)<=Aging[Max]))>0)) How findout current year sales and previous year sales dynamically Current YearSales = CALCULATE(SUM(Orders[Sales]),YEAR(dimdate[Date])=YEAR(TODAY()) ) Previous YearSales = CALCULATE(SUM(Orders[Sales]),YEAR(dimdate[Date])=YEAR(TODAY()) -1) How to Findout the TopN + others salary rankswise = CALCULATE(SUM(Orders[Sales]), FILTER(VALUES(Orders[Customer Name]), COUNTROWS(FILTER('Grouping',[Rankx]>'Grouping'[Min] && [Rankx]<='Grouping'[Max]))>0))
  • 8. (Or) rankswise = CALCULATE(SUM(Orders[Sales]), FILTER(VALUES(Orders[Customer Name]), COUNTROWS(FILTER('Grouping',RANKX(ALL(Orders[CustomerName]),[TotalSales],,DESC)>='Grouping'[Min] && RANKX(ALL(Orders[Customer Name]),[TotalSales],,DESC)<='Grouping'[Max]))>0)) By Using Var calculating Forecast reports: