The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi I am looking to achieve below output . Can someone help on how to do this in DAX.
Account | Interaction Type |
1 | call |
1 | inperson |
2 | call |
3 | inperson |
3 | call |
3 | msg |
looking for formula to achieve count where interaction type is only call ie Account count=1 ( account id 2) |
only msg account count= 0 |
only inperson account count=0 |
multiple interaction account type = 2 (account id 1 and 3 ) |
Appreciate your help !!
Raju
Solved! Go to Solution.
@Anonymous ,
only Call =
countx(filter(summarize(Table, Table[Account], "_1", count(Table[Interaction Type])
, "_2",calculate(count(Table[Interaction Type]), filter(Table, Table[Interaction Type]= "Call"))),
[_1] =[_2]) ,[Account] )
only inperson=
countx(filter(summarize(Table, Table[Account], "_1", count(Table[Interaction Type])
, "_2",calculate(count(Table[Interaction Type]), filter(Table, Table[Interaction Type]= "inperson"))),
[_1] =[_2]) ,[Account] )
only msg=
countx(filter(summarize(Table, Table[Account], "_1", count(Table[Interaction Type])
, "_2",calculate(count(Table[Interaction Type]), filter(Table, Table[Interaction Type]= "msg"))),
[_1] =[_2]) ,[Account] )
Mutiple Interactions =
countx(filter(summarize(Table, Table[Account], "_1", distinctcount(Table[Interaction Type])),
[_1] >=2) ,[Account] )
@Anonymous ,
only Call =
countx(filter(summarize(Table, Table[Account], "_1", count(Table[Interaction Type])
, "_2",calculate(count(Table[Interaction Type]), filter(Table, Table[Interaction Type]= "Call"))),
[_1] =[_2]) ,[Account] )
only inperson=
countx(filter(summarize(Table, Table[Account], "_1", count(Table[Interaction Type])
, "_2",calculate(count(Table[Interaction Type]), filter(Table, Table[Interaction Type]= "inperson"))),
[_1] =[_2]) ,[Account] )
only msg=
countx(filter(summarize(Table, Table[Account], "_1", count(Table[Interaction Type])
, "_2",calculate(count(Table[Interaction Type]), filter(Table, Table[Interaction Type]= "msg"))),
[_1] =[_2]) ,[Account] )
Mutiple Interactions =
countx(filter(summarize(Table, Table[Account], "_1", distinctcount(Table[Interaction Type])),
[_1] >=2) ,[Account] )
Hi Amit,
there is one more scenario to add to this. if the interaction Type is blank then we should not be counting those records . but the above formula is counting in all individual counts(only Call,only msg,only inperson) which is bit off. could you please help how to avoid counting blanks)
Thank you.
Thank you Verymuch Amit . your promt response helped a lot 🙂
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
182 | |
81 | |
63 | |
47 | |
41 |