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