Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Dax Calculation for distinct Values

Hi I am looking to achieve below  output . Can someone help on how to do this in DAX.

 

AccountInteraction Type
1call
1inperson
2call
3inperson
3call
3msg

 

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

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer to my .pbix file.

v-lionel-msft_1-1607328044333.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@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] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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.

 

 

Anonymous
Not applicable

Thank you Verymuch Amit . your promt response helped a lot 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.